Is there anyway i can look into the values of a structure after compilation?
objdump -td gives the function definitions and only the address where the structure is stored. The problem is i am getting a wrong address for one of the threads/functions in a structure when i run a program. The target mcu is lpc1347 (ARM Cortex-m3).
Best How To :
objdump parses object files (products of the compiler), which are relocatable (not executable) ELF files. At this stage, there is no such notion as the memory address these compiled pieces will run at.
You have the following possibilities:
- Link your
*.obj files into the final non-stripped (
-g passed to compiler) executable ELF image and parse it using
- Generate the linker map file by adding
-Wl,-Map,file.map to your
LDFLAGS and see the output sections and addresses your data is located at in the map file.
- Use a debugger/gdb.