This is the mail archive of the gdb-patches@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]

RFA: correctly compute addresses of embedded objects



2001-05-17  Jim Blandy  <jimb@redhat.com>

	* valops.c (value_addr): Don't include VALUE_EMBEDDED_OFFSET in
	the pointer value we return.  It should point at the embedded
	object ARG1 represents, not at the enclosing object ARG1 might
	also be holding.

*** gdb/valops.c.base~	Tue Apr 24 13:50:06 2001
--- gdb/valops.c	Thu May 17 14:58:14 2001
***************
*** 960,967 ****
    /* Get target memory address */
    arg2 = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
  			     (VALUE_ADDRESS (arg1)
! 			      + VALUE_OFFSET (arg1)
! 			      + VALUE_EMBEDDED_OFFSET (arg1)));
  
    /* This may be a pointer to a base subobject; so remember the
       full derived object's type ... */
--- 960,966 ----
    /* Get target memory address */
    arg2 = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
  			     (VALUE_ADDRESS (arg1)
! 			      + VALUE_OFFSET (arg1)));
  
    /* This may be a pointer to a base subobject; so remember the
       full derived object's type ... */


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