This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: METHOD_PTR_*?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 9 Nov 2004 17:10:26 -0500
- Subject: Re: METHOD_PTR_*?
- References: <41912F1E.2000606@gnu.org>
On Tue, Nov 09, 2004 at 03:57:02PM -0500, Andrew Cagney wrote:
> Hello,
>
> From value.h:
>
> /* Pointer to member function. Depends on compiler implementation. */
>
> #define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000)
> #define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET))
> #define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR))
>
> It also depends on the underlying architecture - not very 64-bit
> friendly :-/
Yuck!
If I'm reading this right, it corresponded to some old compiler's
implementation. But nowadays we fake it in
value_struct_elt_for_reference. This is a bit tricky to untangle, but
I think this could be solved entirely in eval.c (and the one place we
print "virtual" and ditching the remaining bits. I wonder if anything
in the testsuite exercises this?
--
Daniel Jacobowitz