mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
gdb/fortran: Breakpoint location is modified.
Breakpoint location is modified to "return" statement which is outside the DO loop. Because the label 100 of DO loop should get executed for each iteration as shared in this external link: http://www-pnp.physics.ox.ac.uk/~gronbech/intfor/node18.html. flang compiler is following this fortran standard, whereas gfortran compiler is not following, hence the test case is passing with gfortran and failing with flang. but to correct this gfortran behavior, bug has been filed in bugzilla (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99816). As reported in the bug, with gfortran, label 100 of DO loop is reached only after the completion of the entire DO loop. Hence at label 100, all the array elements are set and printing of array element a(2) succeeds. whereas with flang, when we are at label 100 for first time, array element a(2) is not yet set, only a(1) is set, hence moving the breakpoint location to outside the DO loop, so that once we are outside the DO loop, we can print any of the array elements. This change in test case is done irrespective of any fortran compiler. gdb/testsuite/ChangeLog: * gdb.fortran/array-element.exp: Breakpoint location is modified.
This commit is contained in:

committed by
Alok Kumar Sharma

parent
8ca5537ba5
commit
abb894a470
@ -1,3 +1,7 @@
|
||||
2021-05-11 Bhuvanendra Kumar <Bhuvanendra.KumarN@amd.com>
|
||||
|
||||
* gdb.fortran/array-element.exp: Breakpoint location is modified.
|
||||
|
||||
2021-05-10 Lancelot Six <lsix@lancelotsix.com>
|
||||
|
||||
PR gdb/27614
|
||||
|
@ -31,8 +31,8 @@ if ![runto sub_] then {
|
||||
continue
|
||||
}
|
||||
|
||||
gdb_breakpoint [gdb_get_line_number "continue"]
|
||||
gdb_continue_to_breakpoint "continue"
|
||||
gdb_breakpoint [gdb_get_line_number "return"]
|
||||
gdb_continue_to_breakpoint "return"
|
||||
|
||||
gdb_test "print a(1)" ".*1 = 1.*" "print the first element of array a"
|
||||
gdb_test "print a(2)" ".*2 = 2.*" "print the second element of array a"
|
||||
|
Reference in New Issue
Block a user