diff options
author | Doug Evans <dje@google.com> | 2010-11-10 17:47:23 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-11-10 17:47:23 +0000 |
commit | 4dfea5604987eeb861eccccafbfa29e38002ea25 (patch) | |
tree | b60c9fc26ba7b10793dcd48a17c6de46024cd360 /gdb/value.c | |
parent | 51020d214bfe2cd8b912db0f3f2fafb40df28bc2 (diff) | |
download | gdb-4dfea5604987eeb861eccccafbfa29e38002ea25.zip gdb-4dfea5604987eeb861eccccafbfa29e38002ea25.tar.gz gdb-4dfea5604987eeb861eccccafbfa29e38002ea25.tar.bz2 |
* value.c (set_value_enclosing_type): Renamed from
value_change_enclosing_type. All callers updated.
* value.h (set_value_enclosing_type): Update.
* valops.c (value_full_object): Always return a copy if we need to
make changes to the input value.
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/value.c b/gdb/value.c index 381318b..85cb62a 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1933,21 +1933,20 @@ value_static_field (struct type *type, int fieldno) return retval; } -/* Change the enclosing type of a value object VAL to NEW_ENCL_TYPE. - You have to be careful here, since the size of the data area for the value - is set by the length of the enclosing type. So if NEW_ENCL_TYPE is bigger - than the old enclosing type, you have to allocate more space for the data. - The return value is a pointer to the new version of this value structure. */ +/* Change the enclosing type of a value object VAL to NEW_ENCL_TYPE. + You have to be careful here, since the size of the data area for the value + is set by the length of the enclosing type. So if NEW_ENCL_TYPE is bigger + than the old enclosing type, you have to allocate more space for the + data. */ -struct value * -value_change_enclosing_type (struct value *val, struct type *new_encl_type) +void +set_value_enclosing_type (struct value *val, struct type *new_encl_type) { if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) val->contents = (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); val->enclosing_type = new_encl_type; - return val; } /* Given a value ARG1 (offset by OFFSET bytes) |