0

I have an STM32 executable generated with GCC from C. In another life, I encountered a .txt file that was output by the compiler which would expand and list all global variables and structs, listing their hex address within the executable and their type - this was useful as it could be parsed by external tools and used to allow us to debug the values within fields in structs and variables that were declared globally without the need for GDB - i.e. we could build it into external tests and automate checks of internal values.

What is the term for this, and is it a default option of GCC or something similar?

The file in question looked somewhat like:

globalStruct->someField.subField T_UINT16 0x400297b31 
globalStruct2->someField.subField[0] T_UINT16 0x400297555 
globalStruct2->someField.subField[1] T_UINT16 0x400297556 
globalStruct2->someField.subField[2] T_UINT16 0x400297557

And so on. Super easy to read and parse as it was space separated.

Emile Victor
  • 923
  • 1
  • 12
  • 22
  • Is this perhaps a duplicate of [this question on linker map files](https://stackoverflow.com/questions/38961649/gcc-how-to-create-a-mapfile-of-the-object-file)? Not sure if that matches what you remember seeing, of course. :) – unwind Feb 12 '19 at 14:29
  • Does the question relate to **CMake** utility? Or why "cmake" tag is used? – Tsyvarev Feb 12 '19 at 14:40
  • Apologies - I can remove CMake - it's just that it's part of our build pipeline; perhaps a bit too high level for this question in particular. Looking at your link now, @unwind – Emile Victor Feb 12 '19 at 14:48

0 Answers0