User Tools

Site Tools


info:c_memory_structure

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
info:c_memory_structure [2012/10/15 17:09] – [Goals] moritzinfo:c_memory_structure [2012/10/15 17:10] – [The missing piece: .debug_section] moritz
Line 50: Line 50:
 The only program that really knows the structure layout in memory is the compiler. It decides about the in-memory structure. Hence, I started investigating if there was a way to extract this information from the compiler. The only program that really knows the structure layout in memory is the compiler. It decides about the in-memory structure. Hence, I started investigating if there was a way to extract this information from the compiler.
  
-===== The missing piece: .debug_section =====+===== The missing piece: .debug_info section =====
  
-C compilers can store additional information to the compiled output in program sections. For ELF files, there is an optional ''.debug_section'' that contains compiler-specific data. It has no standardized structure. Internally it is used to help debugging a program, for example to determine what variable is at what memory location etc. It also stores debug information about the C structures, which is what I am looking for.+C compilers can store additional information to the compiled output in program sections. For ELF files, there is an optional ''.debug_info'' (may have a different name depending on the compiler) that contains compiler-specific data. It has no standardized structure. Internally it is used to help debugging a program, for example to determine what variable is at what memory location etc. It also stores debug information about the C structures, which is what I am looking for.
  
 For different compilers exist different tools to access the debug section content. For GCC, there is objdump, for IAR there exists ielfdump. Both allow to print the debug section in a human-readable form. However, the structure is not documented and requires the programmer to reverse engineer it. (For GCC it is open-source, which is not the case for the IAR C compiler). For different compilers exist different tools to access the debug section content. For GCC, there is objdump, for IAR there exists ielfdump. Both allow to print the debug section in a human-readable form. However, the structure is not documented and requires the programmer to reverse engineer it. (For GCC it is open-source, which is not the case for the IAR C compiler).
info/c_memory_structure.txt · Last modified: 2012/10/16 17:23 by moritz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki