This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] Fortran, typeprint: Decrease level of details when printing elements of a structure.
- From: Bernhard Heckel <bernhard dot heckel at intel dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 12 May 2016 10:00:08 +0200
- Subject: Re: [PATCH 3/4] Fortran, typeprint: Decrease level of details when printing elements of a structure.
- Authentication-results: sourceware.org; auth=none
- References: <1462889739-30359-1-git-send-email-bernhard dot heckel at intel dot com> <1462889739-30359-4-git-send-email-bernhard dot heckel at intel dot com> <86oa8cd870 dot fsf at gmail dot com>
On 11/05/2016 15:40, Yao Qi wrote:
Bernhard Heckel <bernhard.heckel@intel.com> writes:
(gdb) ptype t3v
type = Type t3
integer(kind=4) :: t3_i
Type t2
integer(kind=4) :: t2_i
Type t1 :: t1_n
End Type t2 :: t2_n
End Type t3
Why do we print the "definition" of Type t2? Why don't we print
(gdb) ptype t3v
type = Type t3
integer(kind=4) :: t3_i
Type t2 t2_n
End Type t3
If I do the same in C, GDB doesn't print the definition of struct t2.
(gdb) ptype t1
type = struct t1 {
int i;
struct t2 t2;
}
This is what the comment says:
SHOW nonzero means don't print this type as just its name;
show its real definition even if it has a name.
SHOW zero means print just typename or struct tag if there is one
SHOW negative means abbreviate structure elements.
SHOW is decremented for printing of structure elements.
From that, I understood that I have to print the elements when show is >=0.
Am I wrong? If so, I have to change Patch2.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928