virtual method structure
Ian Lance Taylor
iant@google.com
Fri Dec 18 15:27:00 GMT 2009
Fabian Cenedese <Cenedese@indel.ch> writes:
> If I have a virtual method
>
> virtual unsigned long CClass::vMethod();
>
> and do in the source
>
> unsigned long (CClass::*pvm)() = &CClass::vMethod;
>
> then pvm is a structure (or pointer to it) with the elements
> short __delta
> short __index
> union __pfn_or_delta2
> void* pfn
> short __delta2
>
> These names come directly out of the debug info, they nowhere appear
> in the project's sources. I do see them in the elf file but I don't know if
> the values are fixed or calculated at runtime.
>
> pvm:(0,50)=s8__delta:(0,8),0,16;__index:(0,8),16,16;__pfn_or_delta2:(0,51)=u4__pfn:(0,52)=*(14,53),0,32;__delta2:(0,8),0,16;;,32,32;;
Wow, stabs debugging information.
Did you mention which version of gcc you are using? I think you must
be using the old C++ ABI, i.e. a version of gcc earlier than 3.4,
which was released over five years ago. I don't think I ever knew how
pointer-to-member-functions worked in that ABI. There is no delta2 in
the current gcc ABI.
Ian
More information about the Gcc-help
mailing list