This is the mail archive of the gdb-patches@sourceware.org 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: Fix value_contents_writeable


On Sun, Feb 27, 2005 at 10:45:57AM -0500, Daniel Jacobowitz wrote:
> Hi Andrew,
> 
> This patch:
> 
> 2005-02-01  Andrew Cagney  <cagney@gnu.org>
> 
> 	* value.c (value_contents_all_raw)
> 	(value_contents_raw): New functions.
> 	* value.h (VALUE_CONTENTS_ALL_RAW, VALUE_CONTENTS_RAW): Delete.
> 	(value_contents_raw, value_contents_all_raw): Declare functions.
> 	(VALUE_CONTENTS, VALUE_CONTENTS_ALL): Update.
> 	* std-regs.c, valarith.c, valops.c, eval.c: Update.
> 	* tracepoint.c, findvar.c: Update.
> 
> 
> changed VALUE_CONTENTS to use (val)->aligner.contents instead of the old
> VALUE_CONTENTS_RAW macro, which was (val)->aligner.contents +
> (val)->embedded_offset.  Unfortunately, all the embedded offset bits are
> under-tested, so this had no effect on the testsuite; I don't remember
> exactly how to produce a testcase for it, but I think it would require C++
> RTTI.
> 
> Was the change deliberate?  If not, I'll commit the fix below.

Andrew never responded, so I've committed this fix:

> 2005-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* value.c (value_contents_writeable): Use value_contents_raw.
> 
> Index: value.c
> ===================================================================
> RCS file: /big/fsf/rsync/src-cvs/src/gdb/value.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 value.c
> --- value.c	20 Feb 2005 01:19:24 -0000	1.27
> +++ value.c	27 Feb 2005 15:31:42 -0000
> @@ -355,7 +355,7 @@ value_contents_writeable (struct value *
>  {
>    if (value->lazy)
>      value_fetch_lazy (value);
> -  return value->aligner.contents;
> +  return value_contents_raw (value);
>  }
>  
>  /* Return non-zero if VAL1 and VAL2 have the same contents.  Note that
> 

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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