aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-03 18:55:32 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-03 18:55:32 +0000
commitc54eabfaa80258bf2552f9b6642e61b5d24d716b (patch)
tree29f9568757e1dfce56ff37668a6166c53497848a /gdb/value.c
parent5aade3dba4836d4ca2446fcdf97098338611cc19 (diff)
downloadgdb-c54eabfaa80258bf2552f9b6642e61b5d24d716b.zip
gdb-c54eabfaa80258bf2552f9b6642e61b5d24d716b.tar.gz
gdb-c54eabfaa80258bf2552f9b6642e61b5d24d716b.tar.bz2
gdb/
* gdbtypes.c (check_typedef): New comment on type length. * value.c (allocate_value_lazy): Remove the unused atype variable. New comment on type length. (value_primitive_field): Keep the original TYPE value, new comment. gdb/testsuite/ * gdb.mi/var-cmd.c (do_bitfield_tests): Change "V.sharable" type to "uint_for_mi_testing".
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/value.c b/gdb/value.c
index f4075cf..a462ee4 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -254,7 +254,14 @@ struct value *
allocate_value_lazy (struct type *type)
{
struct value *val;
- struct type *atype = check_typedef (type);
+
+ /* Call check_typedef on our type to make sure that, if TYPE
+ is a TYPE_CODE_TYPEDEF, its length is set to the length
+ of the target type instead of zero. However, we do not
+ replace the typedef type by the target type, because we want
+ to keep the typedef in order to be able to set the VAL's type
+ description correctly. */
+ check_typedef (type);
val = (struct value *) xzalloc (sizeof (struct value));
val->contents = NULL;
@@ -1873,7 +1880,14 @@ value_primitive_field (struct value *arg1, int offset,
CHECK_TYPEDEF (arg_type);
type = TYPE_FIELD_TYPE (arg_type, fieldno);
- type = check_typedef (type);
+
+ /* Call check_typedef on our type to make sure that, if TYPE
+ is a TYPE_CODE_TYPEDEF, its length is set to the length
+ of the target type instead of zero. However, we do not
+ replace the typedef type by the target type, because we want
+ to keep the typedef in order to be able to print the type
+ description correctly. */
+ check_typedef (type);
/* Handle packed fields */