Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
info:c_memory_structure [2012/10/16 17:21] – [Obtaining the debug section data] moritz | info:c_memory_structure [2012/10/16 17:23] (current) – [Using the debug info dump] moritz |
---|
Each line represents either the start of a new entity or adds an attribute to one. All entities and attributes have a unique address, encoded in hex. Each entity has a type, which determines the attributes it has. The entity line consists of a nesting level, the unique address followed by the entity's type ID and a human readable name of the type. Attribute definitions start with the unique ID followed by the attribute name to be defined and a colon. After the colon, the actual value of the attribute follows. It can be a number, a string or a pointer to another entity. The pointer is encoded as ''<0x34>'' which references the entity with unique ID ''34''. This way, the debug info tree can be traversed. | Each line represents either the start of a new entity or adds an attribute to one. All entities and attributes have a unique address, encoded in hex. Each entity has a type, which determines the attributes it has. The entity line consists of a nesting level, the unique address followed by the entity's type ID and a human readable name of the type. Attribute definitions start with the unique ID followed by the attribute name to be defined and a colon. After the colon, the actual value of the attribute follows. It can be a number, a string or a pointer to another entity. The pointer is encoded as ''<0x34>'' which references the entity with unique ID ''34''. This way, the debug info tree can be traversed. |
| |
=== Finding the size information === | ==== Finding the size information ==== |
| |
| |
Here, ''iN'' represent the different bytes of the integer ''i'', same holds for ''s'' and ''c''. There is one byte padding at the end. The size of each member type can be determined by following the ''DW_AT_type'' pointer inside the debug info section. | Here, ''iN'' represent the different bytes of the integer ''i'', same holds for ''s'' and ''c''. There is one byte padding at the end. The size of each member type can be determined by following the ''DW_AT_type'' pointer inside the debug info section. |
| |
==== Using the debug info dump ==== | |
| |
The output of the debug info dump can be read again by a program in order to extract the ''typedef'' structures from it. The information forms a tree with pointers to specific tree elements and next items in the tree on the same level. Traverse type links recursively to obtain the size and encoding of individual types. | |
| |
==== Problems ==== | ==== Problems ==== |