-
Notifications
You must be signed in to change notification settings - Fork 134
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
espflash monitor addr2line is different compared to native add2line #600
Comments
I remember it gives random results if the address doesn't make any sense (e.g. the address doesn't even match any segment) I think @bugadani suggested to not print in yellow. Maybe we shouldn't color that output at all. E.g. when printing the back trace of an exception it should be in red. The addresses fron the ROM bootloader probably shouldn't colored at all. Still might confuse users but maybe it doesn't look that concerning |
espflash is absolutely not correct interpreting |
Besides the fact addr2line seems to be incorrect sometimes, it probably even doesn't make sense trying to resolve addresses at that stage since we are about to load the 2nd stage bootloader here. Resolving the addresses don't make much sense. To make it even harder: if the ROM code prints the last seen PC, resolving it is most probably helpful Maybe we shouldn't try to resolve everything that looks like an address? Maybe have a special syntax to mark something as a resolvable address? (like We could try to be clever by "knowing" what the bootloaders print but that's a can of worms - latest when dealing with other bootloaders But that's not really what the issue is about - how can we improve the results of addr2line? We already added a check if an address is in the range of some segment in the elf ... probably we can add an additional check there. I'll have a look Or maybe have a look at probe-rs? |
Before you go down a rabbit hole, the issue is not that the address is necessarily in a wrong segment (you may very well be interested in code placed to iram_seg), but that the symbol addr2line finds is in a different one. Other than that I think the idea is a useful starting point. |
#603 should make things better But still, I think
|
Additional reading: gimli-rs/addr2line#324 |
Consider the hello world esp32 example startup:
If you actually call
addr2line
on with these addresses you don't get the same output for the first two entries.Though I would argue that espflash is right here (take a look at https://github.com/esp-rs/xtensa-lx/blob/d6b8224d8a3e426be3564481130d994fe73e2bf6/xtensa-lx-rt/exception-esp32.x.jinja#L91-L93) this creates a confusing log where users think that some exception is occurring.
I think somehow we want to avoid this behaviour, but I don't know the best way to approach this.
cc: @bjoernQ I think you poked around in this bit of code last, any suggestions?
The text was updated successfully, but these errors were encountered: