This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Fix value_contents_writeable
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andrew Cagney <cagney at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Sun, 27 Feb 2005 10:45:57 -0500
- Subject: Fix value_contents_writeable
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.
--
Daniel Jacobowitz
CodeSourcery, LLC
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