diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-03-07 16:53:54 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-04-30 10:36:57 +0100 |
commit | bc68014d16c30a6e90fdf9fc43e98be8cbbead9a (patch) | |
tree | 7a4c9a61b37875f64f7919c9024272e0550fd165 /gdb/testsuite/gdb.fortran | |
parent | f1fdc960664c24d911d6189b94e5c054b4bb9053 (diff) | |
download | gdb-bc68014d16c30a6e90fdf9fc43e98be8cbbead9a.zip gdb-bc68014d16c30a6e90fdf9fc43e98be8cbbead9a.tar.gz gdb-bc68014d16c30a6e90fdf9fc43e98be8cbbead9a.tar.bz2 |
gdb/fortran: Add allocatable type qualifier
Types in Fortran can have the 'allocatable' qualifier attached to
indicate that memory needs to be explicitly allocated by the user.
This patch extends GDB to show this qualifier when printing types.
Lots of tests results are then updated to include this new qualifier
in the expected results.
gdb/ChangeLog:
* f-typeprint.c (f_type_print_base): Print 'allocatable' type
qualifier.
* gdbtypes.h (TYPE_IS_ALLOCATABLE): Define.
gdb/testsuite/ChangeLog:
* gdb.fortran/vla-datatypes.exp: Update expected results.
* gdb.fortran/vla-ptype.exp: Likewise.
* gdb.fortran/vla-type.exp: Likewise.
* gdb.fortran/vla-value.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-datatypes.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-ptype.exp | 8 | ||||
-rwxr-xr-x | gdb/testsuite/gdb.fortran/vla-type.exp | 22 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-value.exp | 4 |
4 files changed, 22 insertions, 22 deletions
diff --git a/gdb/testsuite/gdb.fortran/vla-datatypes.exp b/gdb/testsuite/gdb.fortran/vla-datatypes.exp index afe6774..bb5ed27 100644 --- a/gdb/testsuite/gdb.fortran/vla-datatypes.exp +++ b/gdb/testsuite/gdb.fortran/vla-datatypes.exp @@ -55,15 +55,15 @@ gdb_test "print l" " = \\.TRUE\\." "charactervla allocated" gdb_breakpoint [gdb_get_line_number "vlas-initialized"] gdb_continue_to_breakpoint "vlas-initialized" -gdb_test "ptype intvla" "type = $int \\\(11,22,33\\\)" \ +gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)" \ "ptype intvla" -gdb_test "ptype realvla" "type = $real \\\(11,22,33\\\)" \ +gdb_test "ptype realvla" "type = $real, allocatable \\\(11,22,33\\\)" \ "ptype realvla" -gdb_test "ptype complexvla" "type = $complex \\\(11,22,33\\\)" \ +gdb_test "ptype complexvla" "type = $complex, allocatable \\\(11,22,33\\\)" \ "ptype complexvla" -gdb_test "ptype logicalvla" "type = $logical \\\(11,22,33\\\)" \ +gdb_test "ptype logicalvla" "type = $logical, allocatable \\\(11,22,33\\\)" \ "ptype logicalvla" -gdb_test "ptype charactervla" "type = character\\\*1 \\\(11,22,33\\\)" \ +gdb_test "ptype charactervla" "type = character\\\*1, allocatable \\\(11,22,33\\\)" \ "ptype charactervla" gdb_test "print intvla(5,5,5)" " = 1" "print intvla(5,5,5) (1st)" diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp index a40ad91..0f4abb6 100644 --- a/gdb/testsuite/gdb.fortran/vla-ptype.exp +++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp @@ -43,24 +43,24 @@ gdb_test "ptype vla2(5, 45, 20)" \ gdb_breakpoint [gdb_get_line_number "vla1-allocated"] gdb_continue_to_breakpoint "vla1-allocated" -gdb_test "ptype vla1" "type = $real \\\(10,10,10\\\)" \ +gdb_test "ptype vla1" "type = $real, allocatable \\\(10,10,10\\\)" \ "ptype vla1 allocated" gdb_breakpoint [gdb_get_line_number "vla2-allocated"] gdb_continue_to_breakpoint "vla2-allocated" -gdb_test "ptype vla2" "type = $real \\\(7,42:50,13:35\\\)" \ +gdb_test "ptype vla2" "type = $real, allocatable \\\(7,42:50,13:35\\\)" \ "ptype vla2 allocated" gdb_breakpoint [gdb_get_line_number "vla1-filled"] gdb_continue_to_breakpoint "vla1-filled" -gdb_test "ptype vla1" "type = $real \\\(10,10,10\\\)" \ +gdb_test "ptype vla1" "type = $real, allocatable \\\(10,10,10\\\)" \ "ptype vla1 filled" gdb_test "ptype vla1(3, 6, 9)" "type = $real" \ "ptype vla1(3, 6, 9)" gdb_breakpoint [gdb_get_line_number "vla2-filled"] gdb_continue_to_breakpoint "vla2-filled" -gdb_test "ptype vla2" "type = $real \\\(7,42:50,13:35\\\)" \ +gdb_test "ptype vla2" "type = $real, allocatable \\\(7,42:50,13:35\\\)" \ "ptype vla2 filled" gdb_test "ptype vla2(5, 45, 20)" "type = $real" \ "ptype vla2(5, 45, 20) filled" diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp index 407a447..951f118 100755 --- a/gdb/testsuite/gdb.fortran/vla-type.exp +++ b/gdb/testsuite/gdb.fortran/vla-type.exp @@ -46,7 +46,7 @@ gdb_test "print onev%ivla(1, 2, 3)" " = 123" gdb_test "print onev%ivla(3, 2, 1)" " = 321" gdb_test "ptype onev" \ [multi_line "type = Type one" \ - "\\s+$int :: ivla\\\(11,22,33\\\)" \ + "\\s+$int, allocatable :: ivla\\\(11,22,33\\\)" \ "End Type one" ] # Check type with two VLA's inside @@ -57,8 +57,8 @@ gdb_test "print twov%ivla1(1, 2, 3)" " = 123" gdb_test "print twov%ivla1(3, 2, 1)" " = 321" gdb_test "ptype twov" \ [multi_line "type = Type two" \ - "\\s+$int :: ivla1\\\(5,12,99\\\)" \ - "\\s+$int :: ivla2\\\(9,12\\\)" \ + "\\s+$int, allocatable :: ivla1\\\(5,12,99\\\)" \ + "\\s+$int, allocatable :: ivla2\\\(9,12\\\)" \ "End Type two" ] gdb_test "print twov" " = \\\( ivla1 = \\\(\\\( \\\( 1, 1, 1, 1, 1\\\)\ \\\( 1, 1, 321, 1, 1\\\)\ @@ -74,7 +74,7 @@ gdb_test "print threev%ivar" " = 3" gdb_test "ptype threev" \ [multi_line "type = Type three" \ "\\s+$int :: ivar" \ - "\\s+$int :: ivla\\\(20\\\)" \ + "\\s+$int, allocatable :: ivla\\\(20\\\)" \ "End Type three" ] # Check type with attribute at end of type @@ -87,7 +87,7 @@ gdb_test "print fourv%ivla(12)" "no such vector element" gdb_test "print fourv%ivar" " = 3" gdb_test "ptype fourv" \ [multi_line "type = Type four" \ - "\\s+$int :: ivla\\\(10\\\)" \ + "\\s+$int, allocatable :: ivla\\\(10\\\)" \ "\\s+$int :: ivar" \ "End Type four" ] @@ -103,7 +103,7 @@ gdb_test "ptype fivev" \ "End Type five" ] gdb_test "ptype fivev%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(10,10,10\\)" \ + " $int, allocatable :: ivla\\(10,10,10\\)" \ "End Type one" ] # Check array of types containing a VLA @@ -120,7 +120,7 @@ gdb_test "ptype fivearr(1)" \ "End Type five" ] gdb_test "ptype fivearr(1)%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(2,4,6\\)" \ + " $int, allocatable :: ivla\\(2,4,6\\)" \ "End Type one" ] gdb_test "ptype fivearr(2)" \ [multi_line "type = Type five" \ @@ -128,7 +128,7 @@ gdb_test "ptype fivearr(2)" \ "End Type five" ] gdb_test "ptype fivearr(2)%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(12,14,16\\)" \ + " $int, allocatable :: ivla\\(12,14,16\\)" \ "End Type one" ] # Check allocation status of dynamic array and it's dynamic members @@ -141,7 +141,7 @@ gdb_test "ptype fivedynarr(2)" \ "ptype fivedynarr(2), tone is not allocated" gdb_test "ptype fivedynarr(2)%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(<not allocated>\\)" \ + " $int, allocatable :: ivla\\(<not allocated>\\)" \ "End Type one" ] \ "ptype fivedynarr(2)%tone, not allocated" @@ -159,7 +159,7 @@ gdb_test "ptype fivedynarr(1)" \ "End Type five" ] gdb_test "ptype fivedynarr(1)%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(2,4,6\\)" \ + " $int, allocatable :: ivla\\(2,4,6\\)" \ "End Type one" ] gdb_test "ptype fivedynarr(2)" \ [multi_line "type = Type five" \ @@ -167,5 +167,5 @@ gdb_test "ptype fivedynarr(2)" \ "End Type five" ] gdb_test "ptype fivedynarr(2)%tone" \ [multi_line "type = Type one" \ - " $int :: ivla\\(12,14,16\\)" \ + " $int, allocatable :: ivla\\(12,14,16\\)" \ "End Type one" ] diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp index 507137b..be397fd 100644 --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"] gdb_continue_to_breakpoint "vla1-init" gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1" gdb_test "print &vla1" \ - " = \\\(PTR TO -> \\\( $real \\\(<not allocated>\\\) \\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real, allocatable \\\(<not allocated>\\\) \\\)\\\) $hex" \ "print non-allocated &vla1" gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \ "print member in non-allocated vla1 (1)" @@ -56,7 +56,7 @@ with_timeout_factor 15 { "step over value assignment of vla1" } gdb_test "print &vla1" \ - " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\) \\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \ "print allocated &vla1" gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)" gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)" |