METHOD_PTR_*?

Daniel Jacobowitz drow@false.org
Wed Nov 10 03:24:00 GMT 2004


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



More information about the Gdb mailing list