1

I'm using UnDecorateSymbolNameW from dbghelp to un-decorate Microsoft symbol names. When undecorating with UNDNAME_COMPLETE, the symbol name can sometimes have, what I understand to be, some compiler appended information to it. For example a vftable symbol can sometimes have a curly bracket block containing a for keyword followed by a class/interface name, e.g.

SomeClass::'vftable'{for 'Foo::Bar'}

Can anybody inform me as to what the "{for 'Foo::Bar'}" portion of the name means?

Additionally does anybody know of some documentation about this so I can read up as I can't find anything.

Thanks very much!

Bobby
  • 43
  • 5
  • You are not going to find this documented, these are compiler implementation details that are subject to change. A class can have more than one v-table due to multiple inheritance. The postfix ensures their symbols are unique. – Hans Passant Feb 21 '13 at 15:11

1 Answers1

2

Your class SomeClass uses multiple inheritance, and it has multiple base classes with virtual methods. Therefore, SomeClass needs multiple vtables (one for each base class with virtual methods). The {for 'Foo::Bar'} tells you which vtable you have. In this case, it is the vtable for the Foo::Bar base class.

(This should have been self-evident from the name.)

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
  • Thanks, yes indeed this does make sense when you spell it out. Shame there is no documentation for this stuff. Thanks again. – Bobby Feb 21 '13 at 15:58
  • This is all compiler-internal stuff. Compiler-internal stuff tends not to be documented because it can change at any time. – Raymond Chen Feb 21 '13 at 16:04
  • Fair enough, i'm trying to parse as much info from symbols as possible to generate a meta model for something, so a spec on this stuff is interesting to me. But I understand why a formal spec/documentation is not available. – Bobby Feb 21 '13 at 16:21
  • Indeed, earlier versions of the compiler didn't say `{for 'Foo::Bar'}` - it just gave every vtable the same name. Who knows, future versions of the compiler may decorate vtables differently. – Raymond Chen Feb 21 '13 at 17:54