Map File contains obsalutely identical addresses for different functions

354 Views Asked by At

I am trying to get stack trace in release (optimized) build without pdb-s. Currently I am trying to retrieve function addresses during my sample program execution using StackWalk64 function and then map generated addresses to the actual function names using map file generated during linking stage. Please note that optimization is turned on.
I see absolutely identical addresses for two different functions in the generated map file.

 0001:00000000       ?static_function_call@MyTest@@SAXXZ 00401000 f i main.obj
 0001:00000000       ?call_1@MyTest@@QAEXXZ     00401000 f i main.obj

What could be the reason of such a thing, can it be due to optimization ? Then how can this functions be distinguished ? EDIT: Here is the function bodies

#include <iostream>
#include <windows.h>
#include <dbghelp.h>

class __declspec(dllexport) MyTest
{
 public:
   static void static_function_call()
 {
 }
 void call_1()
 {
    static_function_call();
 };
 };

 int main( void )
 {
    try
    {
       MyTest obj;
       obj.call_1();
    }
    catch( ... )
    {
    }
    return ( 0 );
}

Thank you, -Grigor

0

There are 0 best solutions below