-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issues when stepping into a static library #110
Comments
Hey @sven-hoek Thanks for reporting this. When range stepping is enabled, Bloom attempts to analyze all instructions within the given range, and intercept those that may take the target outside of the range. The error message suggests that Bloom was unable to decode a particular opcode, and so it was forced to intercept that instruction, as we don't know what it will do. However, that error is not considered to be fatal and should not result in Bloom crashing or shutting down abruptly. A few things I need from you, please:
As for the fatal error in GDB, I'm not sure if that's even related to the range step, as Bloom simply intercepts any instructions that it could not decode, so it shouldn't affect GDB at all. Have you tried disabling range stepping? Does GDB still crash? You can disable range stepping by setting server:
rangeStepping: false If the issue in GDB is related to range stepping, you can just leave range stepping disabled, for the time being. It will result in degraded stepping performance but at least it won't crash. |
Sorry, the GDB commands I provided in the previous comment, for dumping program memory, were incorrect as the address I have also revised the previous comment. |
Hey @navnavnav , thanks for the quick reply and the clear instructions. Also thanks for creating this great tool including good documentation.
I didn't get to reproduce Bloom crashing to capture that log but here it is with just GDB crashing. I'll upload another log if I get to the point that Bloom also crashes again.
|
I haven't got to try it yet but turning off range-stepping is a good point. Though I stepped through the same code with AVARICE instead of Bloom and GDB also crashed, so there's that. It seems to be rather the GDB side or something about the code I'm debugging (the latter of which hopefully shouldn't be an issue though). I will create a very simple project with a simple library for better experimenting. It may take a little until I get to do that but I'll update you with my findings. |
Thanks for this @sven-hoek So I can see that you have a I was worried that Bloom may be incorrectly decoding the first word (
So, this leads me to believe that, when you attempted to step over that So I think the issue here is with GDB. But before you report this to the GDB devs, can you try reproducing the error with a newer version? Version 10 is a little old. I'm on 12.2, which works great for AVR, IMO. But I understand this may be a headache, as you may have to build it from source (unless you're willing to upgrade to a newer Ubuntu version - the newer repositories seem to host newer versions of the gdb-avr package). |
Yeah I agree. That fatal error in GDB doesn't seem to be caused by the opcode decoding error in Bloom. But whatever is causing the fatal error in GDB may also be the cause for the invalid address range that GDB is sending to Bloom. Worth keeping in mind 👍🏽 |
Thanks for that detailed explanation and great support.
True, I haven't thought of that. I tried gdb 13.2 and stepping through the problematic code still seems to produce errors in GDB. I created a very simple app that also uses a static library to see if it's any library that will cause issues. Kept everything very simple and I can step into the library code without any issues with the same toolchain as before (gdb 10). I assume the other project has some weird configuration that messes up the addressing. I will try to cleanly recreate the project and will see if the error persists. |
Not sure if stepping into the static library is the issue but it seems to happen whenever I try to step into or break in a statically-linked library function.
-Og
.When debugging within VSCode, the Debugging stops but when I run
avr-gdb
in the terminal and connect to Bloom's gdb-server, I can continue, though never able to step into a library function.Bloom itself doesn't always crash and so far I couldn't really pin down when it does. It happens when I am a few lines above a library function call and then try to step over (but not even the library function call itself)...I'll also report the bug on the avr-gdb side.
If there's anything else I could try or any info I could provide, let me know.
The text was updated successfully, but these errors were encountered: