This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: HELP with virtual function names
- To: gcc at gcc dot gnu dot org, mandayrv at nb dot conexant dot com
- Subject: Re: HELP with virtual function names
- From: mike stump <mrs at windriver dot com>
- Date: Mon, 16 Jul 2001 13:19:48 -0700 (PDT)
> 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.