Skip to content

Commit e20c1e4

Browse files
committed
[gdb/testsuite] Simplify gdb.dwarf2/forward-spec.exp
Test-case gdb.dwarf2/forward-spec.exp contains a non-trivial gdb_test_multiple to parse this cooked_index_entry: ... [5] ((cooked_index_entry *) 0x7f01f0004040)^M name: v^M canonical: v^M qualified: ns::v^M DWARF tag: DW_TAG_variable^M flags: 0x2 [IS_STATIC]^M DIE offset: 0xcb^M parent: ((cooked_index_entry *) 0x7f01f00040a0) [ns]^M ... which allows us to verify that the entry has a parent. After commit 8f258a6 ("[gdb/symtab] Dump qualified name of cooked_index_entry") that's no longer necessary. Simplify this by checking for ns::v instead. While we're at it, also fix the test-case for target boards readnow, cc-with-gdb-index and cc-with-debug-names. Tested on x86_64-linux.
1 parent a77ccc8 commit e20c1e4

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed

gdb/testsuite/gdb.dwarf2/forward-spec.exp

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# Check that the DWARF reader works with a a DW_AT_specification that
1717
# refers to a later DIE.
1818

19+
require !readnow
20+
1921
load_lib dwarf.exp
2022

2123
# This test can only be run on targets which support DWARF-2 and use gas.
@@ -72,31 +74,13 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
7274
return -1
7375
}
7476

75-
set in_v 0
76-
gdb_test_multiple "maint print objfiles" "v has a parent" {
77-
-re "^ *\\\[\[0-9\]\\\] *\\(\\(cooked_index_entry\[^\r\n\]*" {
78-
set in_v 0
79-
exp_continue
80-
}
81-
-re "^ *name: *v\[\r\n\]*" {
82-
set in_v 1
83-
exp_continue
84-
}
85-
-re "^ *parent: *\\(\\(cooked_index_entry \\*\\) (0|$hex)\\)" {
86-
if {$in_v} {
87-
if {$expect_out(1,string) == "0"} {
88-
fail $gdb_test_name
89-
} else {
90-
pass $gdb_test_name
91-
}
92-
set in_v 0
93-
}
94-
exp_continue
95-
}
96-
-re "^\[^\r\n\]*\[\r\n\]+" {
97-
exp_continue
98-
}
99-
-re "$gdb_prompt " {
100-
# Done.
101-
}
102-
}
77+
require {string equal [have_index $binfile] ""}
78+
79+
set re_ws "\[ \t\]"
80+
81+
gdb_test_lines "maint print objfiles" \
82+
"v has a parent" \
83+
[multi_line \
84+
"" \
85+
"$re_ws+qualified:$re_ws+ns::v" \
86+
".*"]

0 commit comments

Comments
 (0)