This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: METHOD_PTR_*?


Daniel Jacobowitz wrote:
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!

Can it for the moment be moved out of value.h?


Andrew

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?



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