gcc dump class hierarchy question
I'm finding it difficult to wrap my head around the output of gcc's -fdump-class-hierarchy output. Are there any references/tutorials for using the information that pops out for a given complex class (i.e., multiple virtual inheritance, etc.)? Using c++filt on the output definitely helped but it just led to more questions as well (e.g., calls seemingly being repeated in the vtable, "non-virtual thunks", etc.). Any advice in getting up to speed so that this can be an effective tool to trou开发者_如何学Pythonble shooting things like memory layout issues, determining which functions should be called when, etc.
have you seen the new gcc plugin api http://gcc.gnu.org/wiki/GCC_PluginAPI it will allow you to extract information from the compiler as well.
Also there is http://www.gccxml.org/HTML/Index.html the gcc xml interface that allows you to get at the data. This is used for example http://matt.eifelle.com/2009/07/21/using-gccxml-to-automate-c-wrappers-creation/ with a python interface.
I have spent years researching into various problems like these in the introspector project which is in a horrible state, needs many more years of work.
精彩评论