diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/imported-unit.exp | 26 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 18 |
3 files changed, 40 insertions, 10 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 066a41e..16b982b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2020-04-08 Tom de Vries <tdevries@suse.de> + * lib/gdb.exp (psymtabs_p): New proc. + * gdb.dwarf2/imported-unit.exp: Mark "no static partial symbols in + importing unit" unsupported if there are no partial symbols. + +2020-04-08 Tom de Vries <tdevries@suse.de> + PR testsuite/25760 * gdb.ada/call_pn.exp: Call "maint expand-symtabs". Add xfails. diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit.exp b/gdb/testsuite/gdb.dwarf2/imported-unit.exp index 80d6628..41a7505 100644 --- a/gdb/testsuite/gdb.dwarf2/imported-unit.exp +++ b/gdb/testsuite/gdb.dwarf2/imported-unit.exp @@ -149,19 +149,25 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ gdb_test_no_output "set language c++" +set psymtabs_p [psymtabs_p] + # Verify that the partial symtab for the unit importing the partial unit does # not contain the static partial symbol int, which is defined in the partial # unit. Test-case for PR25646. -gdb_test "main print psymbols" \ - [multi_line \ - " Depends on 1 other partial symtabs\." \ - "\[^\r\n\]*" \ - " Global partial symbols:" \ - " `main', function, $hex" \ - "" \ - ".*"] \ - "no static partial symbols in importing unit" - +set test "no static partial symbols in importing unit" +if { $psymtabs_p } { + gdb_test "main print psymbols" \ + [multi_line \ + " Depends on 1 other partial symtabs\." \ + "\[^\r\n\]*" \ + " Global partial symbols:" \ + " `main', function, $hex" \ + "" \ + ".*"] \ + $test +} else { + unsupported $test +} # Sanity check gdb_test "ptype main" "= int \\(void\\)" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3bd0881..52687ad 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6998,6 +6998,24 @@ proc readnow { } { return 0 } +# Return 1 if partial symbols are available. Otherwise, return 0. + +proc psymtabs_p { } { + global gdb_prompt + + set cmd "maint info psymtab" + gdb_test_multiple $cmd "" { + -re "$cmd\r\n$gdb_prompt $" { + return 0 + } + -re -wrap "" { + return 1 + } + } + + return 0 +} + # Verify that partial symtab expansion for $filename has state $readin. proc verify_psymtab_expanded { filename readin } { |