aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-11-24 23:21:16 +0000
committerTom Tromey <tromey@redhat.com>2008-11-24 23:21:16 +0000
commit8acb6b92f945098d51b301f65af9bacb45fb64df (patch)
treec1b488fd3d76e8ba1bdeb314aedc314b422b0774 /gdb/value.c
parent4cab47abf711f591621f08f1dc3c930da45bb091 (diff)
downloadgdb-8acb6b92f945098d51b301f65af9bacb45fb64df.zip
gdb-8acb6b92f945098d51b301f65af9bacb45fb64df.tar.gz
gdb-8acb6b92f945098d51b301f65af9bacb45fb64df.tar.bz2
* ada-lang.c (value_from_contents_and_address): Move...
* value.c: ... here. * ada-lang.h (value_from_contents_and_address): Move declaration... * value.h: ... here.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 695aa33..904b942 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1686,6 +1686,26 @@ value_from_string (char *ptr)
return val;
}
+/* Create a value of type TYPE whose contents come from VALADDR, if it
+ is non-null, and whose memory address (in the inferior) is
+ ADDRESS. */
+
+struct value *
+value_from_contents_and_address (struct type *type,
+ const gdb_byte *valaddr,
+ CORE_ADDR address)
+{
+ struct value *v = allocate_value (type);
+ if (valaddr == NULL)
+ set_value_lazy (v, 1);
+ else
+ memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type));
+ VALUE_ADDRESS (v) = address;
+ if (address != 0)
+ VALUE_LVAL (v) = lval_memory;
+ return v;
+}
+
struct value *
value_from_double (struct type *type, DOUBLEST num)
{