This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: HELP with virtual function names


> From: Ramanand V Mandayam <mandayrv@nb.conexant.com>
> To: gcc@gcc.gnu.org
> Date: Fri, 13 Jul 2001 18:48:00 -0700 (PDT)

> In the example above, I would like to be able to investigate
> the call expression associated with the line
>     p=b->y(); 
> and print the string 
>     "virtual function call: b->y()"

> Instead, the best I am able to do now is:
>     "virtual function call: b->_vbase.base->__pfn"

Actually, you will find (*b->vtable[20])(), you then lookup and find
the ~20th element in the vtable, and there you will find a _DECL node,
and in it, a name and all sorts of other information.

Or, at run time, you can do the lookup on the address found in the
vtable, and then convert that back to a name via a normal sym table
lookup.

Or, you can instrument sooner (-xref style), and pull the name there.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]