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).
How to check the values of a struct from an image/binary file?
217 views Asked by DarthSpeedious At
1
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:
*.obj
files into the final non-stripped (-g
passed to compiler) executable ELF image and parse it usingreadelf
.-Wl,-Map,file.map
to yourLDFLAGS
and see the output sections and addresses your data is located at in the map file.