Jump to content
  • Advertisement
Sign in to follow this  
JanT

visual c++ internal symbol names

This topic is 4680 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A compiler apparently generates these internal names for functions. They look like this:
?test_function@@YAXXZ
?do_something@@YIHH@Z
I'm wondering what's the meaning all that extra stuff besides function name. Can they be decrypted into something meaningful? The reason I'm intrested is, I experimented on doing a stack trace for a c++ program, and succeeded. It traverses back the stack, with the help of the ebp - register. It reads return addresses pushed in, and compares them to function address read in from linker generated .map - file. The corresponding names are in above format in the map file. It would be nice to print out something pretty, instead of those ugly symbol names.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by JanT
I'm wondering what's the meaning all that extra stuff besides function name.


Since you can overload functions in C++, the compiler must have a way of distinguishing between two functions with the same name (but different parameters). To do that, the compiler extends the names with information about the parameters. For example:
    void foo( int x );       --> ?foo@@YAXH@Z
void foo( char * y ); --> ?foo@@YAXPAD@Z

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!