1

I have seen in the past output from a compiler where it would "unzip" nested global structs and variables into a file, along with their variable types and size - this allowed us to give human readable output later for a given binary instead of addresses of functions etc, and also allowed us to reach in and directly modify or read values in our firmware from our simulator at runtime.

Is this at all possible to do with clang or gcc? I'm talking about output like the following, where globalStructVariable is a struct with nested structs and variables, and we also have functions mixed in:

LOCATION                 VARIABLE NAME                                   TYPE
0x2000000                globalStructVariable                            struct
0x2000002                globalStructVariable->blah                      uint
0x2000522                someFunction                                    function

Has anyone here seen this before, and know how to implement it?

Emile Victor
  • 923
  • 1
  • 12
  • 22

0 Answers0