Source code using 5 variables in main
It seems like GDB is using a wrong offset when it shows variables in main().
Source code using 5 variables in main
This is the compiled and linked elf file
This is what I see when I print the variables in GDB
Stopping execution at line "a=b+c" gives me the following values for the
variables.
a=0; b=1;c=2;d=3;e=4;
Stopping execution at line "return 0" gives me the following values for the
variables.
a=0;b=5;c=2;d=9;e=7;
When I dump the memory I see the correct values (at line "return 0")
a=5;b=2;c=9;d=7;e=5;
Reproducible with -ggdb, no optimization. Generated dwarf code appears correct. Problem deferred to msp430-gdb maintainer (there is none currently).
I see this too. It looks as though only -fomit-frame-pointer is needed though to solve the problem.
Log in to post a comment.