[fetter-devel] Re: Visual C++ ABI references

John Pallister john at synchromesh.com
Fri Oct 28 22:33:09 UTC 2005


Rayiner Hashem wrote:
>> I've found this MSDN article called "C++ Under the Hood" 
>> (http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvc/html/jangrayhood.asp)
>>  from 1996 (i.e. Visual C++ 4.2), and a few nuggets from Raymond Chen's
>> weblog (http://blogs.msdn.com/oldnewthing/default.aspx), but not much else.
> 
> Yes, this is the same article I'm using as my primary guide.

Curses, I was hoping you'd found something more recent. ;)

>> Can you suggest any additional references (preferably online)? I'm posting
>> this to the list so that this can all be added to the general historical
>> record.
> 
> In theory the Visual C++ v-table format is the same as the COM one, but I
> can't seem to find the COM v-table spec clearly defined anywhere. Perhaps its
> in one of the MSDN references, but I haven't been able to find it online.

Raymond Chen discusses the layout of COM objects in his blog:
http://blogs.msdn.com/oldnewthing/archive/2004/02/05/68017.aspx
(requires Internet Explorer to view VML diagrams - couldn't just use SVG, oh no)
With additional discussion of "adjustor thunks":
http://blogs.msdn.com/oldnewthing/archive/2004/2/6.aspx
Also, a good discussion of pointers to member functions:
http://blogs.msdn.com/oldnewthing/archive/2004/02/09/70002.aspx

> What is tremendously useful is the WinDbg app, which has a command ("dt" for
> dump table), that dumps the virtual-table layout for any dynamic class. With
> a little consideration to the special cases of C++ v-table layout
> (specifically, simple multiple-inheritence, virtual inheritence, and
> empty-base-class or near-empty-base-class optimizations), a little fooling
> around in WinDbg should tell you everything you need to know.

Excellent! That's great to know.

In other news, I watched Herb Sutter's PDC talk (via http://www.gotw.ca/) and
apparently lambda functions are coming to standard C++, "by the end of the
decade." I think that's pretty cool.

Cheers,

John :^P
-- 
John Pallister
john at synchromesh.com





More information about the fetter-devel mailing list