diff options
author | Tom Tromey <tromey@redhat.com> | 2008-11-24 23:21:16 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2008-11-24 23:21:16 +0000 |
commit | 8acb6b92f945098d51b301f65af9bacb45fb64df (patch) | |
tree | c1b488fd3d76e8ba1bdeb314aedc314b422b0774 /gdb | |
parent | 4cab47abf711f591621f08f1dc3c930da45bb091 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/ada-lang.c | 20 | ||||
-rw-r--r-- | gdb/ada-lang.h | 4 | ||||
-rw-r--r-- | gdb/value.c | 20 | ||||
-rw-r--r-- | gdb/value.h | 4 |
5 files changed, 32 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 984cf47..4467e97 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2008-11-24 Tom Tromey <tromey@redhat.com> + + * 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. + 2008-11-24 Paul Pluzhnikov <ppluzhnikov@google.com> * valprint.c (val_print_array_elements): Pass correct diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2ccba78..1dc3c88 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -465,26 +465,6 @@ is_suffix (const char *str, const char *suffix) return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0); } -/* 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; -} - /* The contents of value VAL, treated as a value of type TYPE. The result is an lval in memory if VAL is. */ diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 562a867..440558c 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -257,10 +257,6 @@ extern int ada_value_print (struct value *, struct ui_file *, /* Defined in ada-lang.c */ -extern struct value *value_from_contents_and_address (struct type *, - const gdb_byte *, - CORE_ADDR); - extern void ada_emit_char (int, struct ui_file *, int, int); extern void ada_printchar (int, struct ui_file *); 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) { diff --git a/gdb/value.h b/gdb/value.h index 65fea99..384a1ed 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -289,6 +289,10 @@ extern struct value *value_from_string (char *string); extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); +extern struct value *value_from_contents_and_address (struct type *, + const gdb_byte *, + CORE_ADDR); + extern struct value *default_value_from_register (struct type *type, int regnum, struct frame_info *frame); |