Re: [PATCH 2/4] Fortran, typeprint: Take level of details into account when printing elements of a structure.

Yao Qi
2016-05-11T12:09:49Z

Bernhard Heckel <bernhard.heckel@intel.com> writes:

Hi Bernhard,
Patch is good to me, some comments below,

> According to the typeprint's description, elements of a structure
> should not be printed when show is <= -1.

s/<= -1/< 0/ ?

> This variable is also used to distinguish the level of details
> between "ptype" and "whatis" expressions.
>
> Before:
> (gdb) whatis t1v
> type = Type t1
> integer(kind=4) :: t1_i
> real(kind=4) :: t1_r
> End Type t1
>
> After:
> (gdb) whatis t1v
> type = Type t1
>
> 2016-05-09 Bernhard Heckel <bernhard.heckel@intel.com>
>
> gdb/Changelog:
> * f-typeprint.c (f_type_print_base): Don't print structure fields when show is <= -1.
>

This line is too long. s/ <= -1/ < 0/

> diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
> index edaf4fd..2caebe6 100644
> --- a/gdb/testsuite/gdb.fortran/whatis_type.exp
> +++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
> @@ -38,17 +38,8 @@ gdb_continue_to_breakpoint "bp1"
> set t1_i "$int :: t1_i"
> set t1_r "$real :: t1_r"
>
> -gdb_test "whatis t1" \
> - [multi_line "type = Type t1" \
> - " $t1_i" \
> - " $t1_r" \
> - "End Type t1"]
> -
> -gdb_test "whatis t1v" \
> - [multi_line "type = Type t1" \
> - " $t1_i" \
> - " $t1_r" \
> - "End Type t1"]
> +gdb_test "whatis t1" "type = Type t1"
> +gdb_test "whatis t1v" "type = Type t1"
>
> gdb_test "ptype t1" \
> [multi_line "type = Type t1" \

This patch can be the first one in this series, and you don't have to
adjust the test of "whatis" back and forth (I mean in patch 1 and 2).

--
Yao (齐尧)