This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V4 5/6] Resolve dynamic target types of pointers.
- From: Bernhard Heckel <bernhard dot heckel at intel dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Mon, 17 Oct 2016 14:18:01 +0200
- Subject: Re: [PATCH V4 5/6] Resolve dynamic target types of pointers.
- Authentication-results: sourceware.org; auth=none
- References: <1473230295-809-1-git-send-email-bernhard.heckel@intel.com> <1473230295-809-6-git-send-email-bernhard.heckel@intel.com> <86k2dc8hri.fsf@gmail.com> <57FFA0CC.1040800@intel.com> <86bmyj8dwf.fsf@gmail.com> <5804B509.7050103@intel.com>
On 17/10/2016 13:24, Bernhard Heckel wrote:
On 17/10/2016 12:32, Yao Qi wrote:
Bernhard Heckel <bernhard.heckel@intel.com> writes:
+set test "print intap, not associated"
+gdb_test_multiple "print intap" $test {
+ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not
associated>\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re " = <not associated>\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
Why do we need to different regex here? Need to handle the
differences
of different compilers? IMO, the former looks reasonable to me.
A pointer to an array (especially to Variable Length Array, VLA) is
described in Gfortran's compiled debug info
like normal array types + associated property of an pointer.
Could you show the debug information gfortran and ifort generates
respectively?
see attachment
Not sure if this is a bug in Gfortran or not? I was also thinking to
make the
output equal, and check if an array has pointer attributes but ..... I
don't really like this approach. This would
cause a lot of "if .. else" construct in the code for example:
De-reference this pointer, Address operator, ...
If gfortran people confirm it is a bug, we can xfail the test.
I just looked again in the specification. It is not a bug.
FORTRAN specification (http://www.j3-fortran.org/doc/year/04/04-007.pdf)
mention this as "array pointer"
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