Hi,
When I load a simple C target binary built with arm-non-eabi tool chain loaded on the ARmCortex-M7 Fast Model in the fast Models framework it fails to show the local variables complaining "??? (can't read from memory from 0xFFFFFFFFFFFFFFF4 (size =4).
My compile command is utterly simple:
arm-none-eabi-gcc -march=armv6-m -mthumb -g3 -c -o <source>.o <source>.c
Anyone has an idea what's wrong ?
Regards,
CD
Investigating further I don't think the linker script has an issue, even when I had a .stack region allocated the issue persisted.
Within the main() if I declare a variable as static then again the debugger sees it at run time. So my best educated guess is that the debugger cannot resolve the symbols that are in automatic scope, for some reason. Not tried looking into the different debug formats (stabs, dwarf etc.) which one do ARM native tools work with seamlessly.
For now I can workaround with debugging declaring variables in global scope or static if in local scope and once all is good revert them as automatic variables in local scope and move on. Would like to get a resolution to the issue -if someone can enlighten me
I'd still say that's likely down to "optimisation".
eg, the compiler has not put those things in memory - just in registers.
The compiler is not obliged to generate "useless" code - even if "optimisation" is turned off.
Well, then there should be some way / hook to turn that so called optimization off to debug embedded code, shouldn't it be - like the compiler writers do not know that - I do not believe it. Do u know how to get around it if you think that is the reason ? There is an option -Og that tells the compiler to "optimize" code that is debugger friendly, have not tried it, but am 99% skeptical it won't work. Will check that out. On the same lines - and to your point - I plan to build it with armcc when I get the cycles to do so and update my findings
I found a resolution to this - finally.
The model debugger successfully shows the local variables when target is built with DWARF2 debugging format, so building the target code with -gwarf-2 option fixed the issue. The default format of debugging info, I believe stabs does not work