Hello,
I am using ARM Development Studio for debugging and have encountered some problems with the debugger's handling of large c structs. EDIT: The following part about size is unrelated to the bug and I misread the numbers (see first Answer to this post).In the variables view it shows the following for my struct vm:
struct vm
However, the actual size of struct vm is 76256 (I added a print to get sizeof(struct vm)) and I am unable to access fields of the struct that are outside of the size shown in the Variables view.
sizeof(struct vm)
Even when using the debugger commands to print vms[0].something it fails with ERROR(EXP16): Member "something" not found despite something being a member of the struct.
vms[0].something
ERROR(EXP16): Member "something" not found
Is there a way to view larger structs with the ARM Debugger?
I am thankful for any help!
Greetings
Martin.S
Hi again Martin,We've identified an issue with the (default) LLVM DWARF parser in Arm DS Debugger.With large structs, when the offset to a member reaches a certain size, it gets put into a different datatype, which is then being interpreted incorrectly by the Debugger. Unfortunately, this issue affects all recent versions of Arm DS, including the new version 2024.0.The workaround is to switch to the old DWARF parser.Select Window > Preferences, then Arm DS > Debugger > Dwarf Parser, then untick "Use LLVM Dwarf Parser".I've tested that this works for images compiled with Arm Compiler 6.If you are compiling with a recent GCC, you may need to compile with the option -gdwarf-4 to select DWARF4 debug tables, because the old Dwarf Parser doesn't support DWARF5.Is the ordering of the members critical in your struct? If not, then an alternative workaround could be to move the members that you want to debug to the top of the struct.I'm sorry that you've hit this issue, but thank you for reporting it. We'll endeavor to fix this in the next release.Stephen
Hi Stephen,
Sorry that I didn't reply earlier. First off, unticking "Use LLVM Dwarf Parser" indeed fixed the bug and now I am able to see all struct members!Great to hear that you could reproduce the error and are working on a fix.
About the size in my original post, I somehow misread the numbers and thought the size shown in ARM DS was smaller than the actual size in bytes.I did not encounter members shown as "Optimized Away" (apart from occasions where I assume they acutally were optimized).
Thanks for your fast help and the workaround.Kind Regards
Martin