diff options
author | Markus Deuling <deuling@de.ibm.com> | 2008-04-22 06:53:18 +0000 |
---|---|---|
committer | Markus Deuling <deuling@de.ibm.com> | 2008-04-22 06:53:18 +0000 |
commit | 9eec4d1e39028b54f54638c90b2c628b958162fe (patch) | |
tree | 01ab148246a55aa0a0bf1b48c8956d0e42a40094 /gdb | |
parent | 68837c9d8d2b2fed53f1232a82d333b23d01e320 (diff) | |
download | gdb-9eec4d1e39028b54f54638c90b2c628b958162fe.zip gdb-9eec4d1e39028b54f54638c90b2c628b958162fe.tar.gz gdb-9eec4d1e39028b54f54638c90b2c628b958162fe.tar.bz2 |
* eval.c (evaluate_subexp_standard): Use value_subscripted_rvalue for
multi_f77_subscript to support values from registers.
* valarith.c (value_subscripted_rvalue): Remove prototype and static.
* value.h (value_subscripted_rvalue): Add prototype.
* f-typeprint.c (f_type_print_base): Add support for TYPE_CODE_UNION.
Fix output.
* f-valprint.c (f_val_print): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/eval.c | 2 | ||||
-rw-r--r-- | gdb/f-typeprint.c | 14 | ||||
-rw-r--r-- | gdb/f-valprint.c | 5 | ||||
-rw-r--r-- | gdb/valarith.c | 3 | ||||
-rw-r--r-- | gdb/value.h | 1 |
6 files changed, 28 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 976fea1..db29ac8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2008-04-22 Markus Deuling <deuling@de.ibm.com> + + * eval.c (evaluate_subexp_standard): Use value_subscripted_rvalue for + multi_f77_subscript to support values from registers. + * valarith.c (value_subscripted_rvalue): Remove prototype and static. + * value.h (value_subscripted_rvalue): Add prototype. + + * f-typeprint.c (f_type_print_base): Add support for TYPE_CODE_UNION. + Fix output. + * f-valprint.c (f_val_print): Likewise. + 2008-04-21 Craig Silverstein <csilvers@google.com> * dwarf2read.c (zlib_decompress_section): Define abfd in the @@ -1720,7 +1720,7 @@ evaluate_subexp_standard (struct type *expect_type, returns the correct type value */ deprecated_set_value_type (arg1, tmp_type); - return value_ind (value_add (value_coerce_array (arg1), arg2)); + return value_subscripted_rvalue (arg1, arg2, 0); } case BINOP_LOGICAL_AND: diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index d55c165..ad93152 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -368,14 +368,22 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, break; case TYPE_CODE_STRUCT: - fprintfi_filtered (level, stream, "Type "); + case TYPE_CODE_UNION: + if (TYPE_CODE (type) == TYPE_CODE_UNION) + fprintfi_filtered (level, stream, "Type, C_Union :: "); + else + fprintfi_filtered (level, stream, "Type "); fputs_filtered (TYPE_TAG_NAME (type), stream); fputs_filtered ("\n", stream); for (index = 0; index < TYPE_NFIELDS (type); index++) { - f_print_type (TYPE_FIELD_TYPE (type, index), "", stream, show, level + 4); + f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show, + level + 4); fputs_filtered (" :: ", stream); - fputs_filtered (TYPE_FIELD_NAME (type, index), stream); + fprintfi_filtered (level, stream, "%s", + TYPE_FIELD_NAME (type, index)); + f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), + stream, 0, 0, 0); fputs_filtered ("\n", stream); } fprintfi_filtered (level, stream, "End Type "); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index b2e3271..70ad59f 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -589,9 +589,10 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, break; case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: /* Starting from the Fortran 90 standard, Fortran supports derived types. */ - fprintf_filtered (stream, "{ "); + fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { int offset = TYPE_FIELD_BITPOS (type, index) / 8; @@ -601,7 +602,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, if (index != TYPE_NFIELDS (type) - 1) fputs_filtered (", ", stream); } - fprintf_filtered (stream, "}"); + fprintf_filtered (stream, " )"); break; default: diff --git a/gdb/valarith.c b/gdb/valarith.c index 7d6f35b..7e6b66e 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -39,7 +39,6 @@ #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2) #endif -static struct value *value_subscripted_rvalue (struct value *, struct value *, int); static struct type *unop_result_type (enum exp_opcode op, struct type *type1); static struct type *binop_result_type (enum exp_opcode op, struct type *type1, struct type *type2); @@ -257,7 +256,7 @@ value_subscript (struct value *array, struct value *idx) (eg, a vector register). This routine used to promote floats to doubles, but no longer does. */ -static struct value * +struct value * value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound) { struct type *array_type = check_typedef (value_type (array)); diff --git a/gdb/value.h b/gdb/value.h index 5f8fe58c0..55eb253 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -558,4 +558,5 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); +extern struct value * value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound); #endif /* !defined (VALUE_H) */ |