This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] corner case in value_from_contents_and_address
- From: Jerome Guitton <guitton at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 27 Nov 2008 16:01:02 +0100
- Subject: [RFA] corner case in value_from_contents_and_address
Second fix for the test failure mentioned in:
http://sourceware.org/ml/gdb-patches/2008-11/msg00718.html
if a null valaddr and a null address is passed to
value_from_contents_and_address, it will return a lazy not_lval
value. As a lazy value cannot be not_lval, the next fetch of this lazy
value will fail.
I think that we should not make a special case when address = 0.
This function should always return a lval_memory value. This is
actually what one would infer from the function comment.
OK to apply?
Thanks,
Jerome
2008-11-27 Jerome Guitton <guitton@adacore.com>
* value.c (value_from_content_and_address): Always return
a lval_memory value, even if address is null.
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.72
diff -u -p -r1.72 value.c
--- value.c 26 Nov 2008 16:27:27 -0000 1.72
+++ value.c 27 Nov 2008 15:00:31 -0000
@@ -1704,8 +1704,7 @@ value_from_contents_and_address (struct
else
memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type));
VALUE_ADDRESS (v) = address;
- if (address != 0)
- VALUE_LVAL (v) = lval_memory;
+ VALUE_LVAL (v) = lval_memory;
return v;
}