Author Topic: setting linker options for map file  (Read 3329 times)

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
setting linker options for map file
« on: July 26, 2010, 07:25:56 pm »
Hi,

how can I set a linker option to get a map file output including local symbols?
I'm using MinGW as the standard compiler in codeblocks.

Here is a code snipped of a simple console app named "Test":

#include <iostream>

using namespace std;

int iGlobalVar;

static int iStaticVar;

int main()
{
    cout << "Hello world!" << endl;
    
    iGlobalVar = 4;
    
    iStaticVar = iGlobalVar / 2;
    
    iGlobalVar = iStaticVar + 1;
    
    return 0;
}

How can i get a both symbols, iStaticVar and iGlobalVar, to be output in a map file?

So far I tried:
"ld.exe .\bin\Debug\Test.exe -M > Symbol.map"

The global symbol "iGlobalVar" occures in the map file, but I could not find an option to get the local symbol to be output in that file.

I need this feature to implement a simple debugger.
I build the debug target of my application, which has an interface to view and modify symbols without the codeblocks IDE.

Any help appreciated!
« Last Edit: July 28, 2010, 11:14:32 am by tom0769 »