This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Multi-dimensional Fortran arrays issue PR11104


On Wed, 17 Nov 2010 09:44:56 +0100, Andrew Burgess wrote:
> tested on x86-64 with no regressions.

There is a regression on {x86_64,x86_64-m32,i686}-fedora14-linux-gnu:
	-PASS: gdb.python/py-value.exp: Test multiple subscript
	+FAIL: gdb.python/py-value.exp: Test multiple subscript
	-PASS: gdb.python/py-value.exp: Test multiple subscript
	+FAIL: gdb.python/py-value.exp: Test multiple subscript


This is not a real review, just some simple parts before I get to the core.


> +  /* Peel of the array indices until we reach the array element type */
> +  do
> +    {
> +      elt_type = TYPE_TARGET_TYPE (elt_type);
> +    }
> +  while (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY);

Here should be check_typedef during each peel.  I do not have a break
reproducer but at least fpc-2.4.2-0.1.rc1.fc15.x86_64 produces such
typedef-wrapped arrays and they are valid DWARF:
	program p;
	type a = array[1..2] of integer;
	type b = array[1..2] of a;
	var
	  v : b;
	begin
	  v[1, 1] := 1;
	  writeln (v[1, 1]);
	end.

Just Pascal does not use this function but anyway.


> +set testfile "multi-dim"
> +set srcfile ${testfile}.f90
> +set binfile ${objdir}/${subdir}/${testfile}
> +
> +if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
> +	executable {debug f77}] != ""} {
> +    return -1
> +}
> +
> +gdb_exit
> +gdb_start
> +gdb_reinitialize_dir $srcdir/$subdir
> +gdb_load ${binfile}

Here could be prepare_for_testing (OK, not used everywhere now).


> +gdb_test "break 20" \
> +    "Breakpoint.*at.* file .*$srcfile, line 20\\." \
> +    "breakpoint at line 20"

Here should be gdb_get_line_number call as hardcoded line numbers (20) make
later updates difficult.


> +gdb_test "continue" \
> +    "Breakpoint 2, test \(\).*at.*multi-dim\.f90:20.*" \
> +    "Continue to breakpoint"
[...]
> +gdb_test "print foo" \
> +    "\\\$2 = \\(\\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 10\\) \\) \\( \\( 10, 10\\) \\( 10, 10\\) \\( 10, 20\\) \\) \\)" \

Hardcoded breakpoint and or output ($2) numbers also make later updates
difficult.


> +gdb_exit

Not needed at the testfile end.


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]