I am trying to dump the contents of a binary file, which is obtained as a raw bin content of a C struct in my embeded SW. Currently I am able to achieve this by executing the following in GDB
- File path/to/myelf.elf
- run path/to/myelf.elf
- Ctrl-C to send SIGINT
- restore path/to/mybin.bin 0xADDRESS
- p *(*my_c_strct) 0xADDRESS
Even though all this works without connecting to my board using JTAG, my question is why do I have to "run" the elf file and "restore" contents of the bin file to a memory and then only able to "print" my_c_struct?
In an ideal world I would like to be able to have a tool to which if I provide the following it will dump my struct content. May be there is another tool I can use in GNU tool chain for this that I am unaware of!
- Provide the symbol file
- Provide my bin dump
- And then print my_c_struct
Thank you ALL.