diff options
author | Bernhard Heckel <bernhard.heckel@intel.com> | 2016-05-25 08:47:17 +0200 |
---|---|---|
committer | Bernhard Heckel <bernhard.heckel@intel.com> | 2016-05-25 08:47:17 +0200 |
commit | e188eb36215c031304aa7d2630447e2d0726adf5 (patch) | |
tree | f30ecc0667ade42730c7572c9afc63a9dfd0aeae /gdb/f-typeprint.c | |
parent | 9b2db1fd27cea1323a7ae0beb9399c8e1c4a3741 (diff) | |
download | binutils-gdb-e188eb36215c031304aa7d2630447e2d0726adf5.tar.gz |
Fortran, typeprint: Decrease level of details when printing elements of a structure.
According to the typeprint's description, the level of details is
decreased by one for the typeprint of elements of a structure.
Before:
(gdb) ptype t3v
type = Type t3
integer(kind=4) :: t3_i
Type t2
integer(kind=4) :: t2_i
Type t1
integer(kind=4) :: t1_i
real(kind=4) :: t1_r
End Type t1 :: t1_n
End Type t2 :: t2_n
End Type t3
After:
(gdb) ptype t3v
type = Type t3
integer(kind=4) :: t3_i
Type t2 :: t2_n
End Type t3
2016-05-25 Bernhard Heckel <bernhard.heckel@intel.com>
gdb/Changelog:
* f-typeprint.c (f_type_print_base): Decrease show by one.
gdb/testsuite/Changelog:
* gdb.fortran/type.f90: Add nested structures.
* gdb.fortran/whatis-type.exp: Whatis/ptype nested structures.
* gdb.fortran/derived-type.exp: Adapt expected output.
* gdb.fortran/vla-type.exp: Adapt expected output.
Diffstat (limited to 'gdb/f-typeprint.c')
-rw-r--r-- | gdb/f-typeprint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index f38a3a0af49..350def0013c 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -371,12 +371,12 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, fputs_filtered ("\n", stream); for (index = 0; index < TYPE_NFIELDS (type); index++) { - f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show, - level + 4); + f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, + show - 1, level + 4); fputs_filtered (" :: ", stream); fputs_filtered (TYPE_FIELD_NAME (type, index), stream); f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), - stream, 0, 0, 0, 0); + stream, show - 1, 0, 0, 0); fputs_filtered ("\n", stream); } fprintfi_filtered (level, stream, "End Type "); |