-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp8266 ScratchABit error #1
Comments
Well, this is definitely not ida-xtensa2 bug, but ScratchABit's ;-). (But nevermind) So, some unexpected condition happens when loading http_get.out file. It's fully dependent on it that file, so I won't be able to tell much without it. Feel free to attach it to this ticket if you're interested in me looking into it. In the meantime, did you try examples included with ScratchABit, as described in its README (those are x86/x86_64, right)? And as a next step, did you try https://github.com/pfalcon/xtensa-subjects/tree/master/2.0.0-p20160809 , which is known good (and pretty big for a test) Xtensa case? |
Here is the file: http_get.tar.gz I tried the included example for x86 and it works fine. Also https://github.com/pfalcon/xtensa-subjects/tree/master/2.0.0-p20160809 loads fine. I tried to use configuration from
And get different error:
|
Ok, so the problem is funkily code-generated noreturn functions, and the fact that ScratchABit isn't (yet? at all?) well designed for not fully valid code. See the disassembly with assertion disabled:
So In the meantime, I'm definitely looking into trying to alleviate this issue in ScratchABit. |
Btw, even esp-open-sdk now (half year at least) uses 4.8.5. And as I mentioned to @projectgus long ago, esp-open-sdk's role is very simple: provide a known-good toolchain for novices or busy people who don't know how to build toolchain of or don't want to bring more instability (on gcc version side) to otherwise already very unstable esp8266 environment. Advanced users should use gcc-xtensa from upstream crosstool-NG (and work with @jcmvbkbc to test whatever isn't yet upstream and provide motivation for him to upstream it). This is of course all offtopic wrt to ScratchABit breakage. |
I'm pretty sure that no gcc version does tail call optimization for xtensa, for windowed ABI due to the calling convention, and for call0 because I didn't think about it when I did the port, so it inherited windowed ABI behavior. But it should be possible with call0, I'll take a look at it. |
Thanks for the prompt reply, as usual. ;-). At your convenience of course, I don't think that anybody in hurry on it. |
Ok, so back to the subject of the reported issue - the underlying cause is described pfalcon/ScratchABit#14 , it's something which I was afraid might bite some time, thanks for providing a testcase for that. So I by now have a change which make http_get.out to be properly disassembled, but it regressed function boundary detection functionality, so need more work yet. |
Thanks for such a quick response. |
@sheinz : Sorry that it took extra time to finish it. Current ScratchABit master with current ida-xtensa2 master (both need to be updated) works on your http_get example. If you look further into it, feel free to report any issues you see, I'm set to make ScratchABit reliably working for various usages. |
Hi @pfalcon,
I'm trying to get ScratchABit + ida-xtensa2 to work for esp8266 disassembly and having the following error:
Here's my configuration file:
Python version 3.5.2
Is there something wrong with my configuration?
Thanks
The text was updated successfully, but these errors were encountered: