public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Improve failure mode in gdb.dwarf2/enqueued-cu-base-addr.exp
@ 2023-08-10 13:49 Tom de Vries
  2023-08-10 13:49 ` [pushed] [gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp with cc-with-gnu-debuglink Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-08-10 13:49 UTC (permalink / raw)
  To: gdb-patches

I ran test-case gdb.dwarf2/enqueued-cu-base-addr.exp with target board
cc-with-debug-names, and ran into:
...
FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: ptype foo (GDB internal error)
FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: CU addr found
...

The first FAIL is a known issue, PR symtab/29572.

The following FAIL is a consequence of the first FAIL, so require for the
second test that the first test passes.

Tested on x86_64-linux, with target boards unix and cc-with-debug-names.
---
 gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
index b60c02085b4..9b2d1d87362 100644
--- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
@@ -76,7 +76,15 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
 }
 
 # Expand cu1.  This will enqueue cu2.
-gdb_test "ptype foo" "type = int"
+set cu1_expanded 0
+gdb_test_multiple "ptype foo" "" {
+    -re -wrap "type = int" {
+	set cu1_expanded 1
+	pass $gdb_test_name
+    }
+}
+
+require {expr $cu1_expanded == 1}
 
 # Now check that cu2 has an address range starting at main.
 set cu2_blockvector_re \
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pushed] [gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp with cc-with-gnu-debuglink
  2023-08-10 13:49 [pushed] [gdb/testsuite] Improve failure mode in gdb.dwarf2/enqueued-cu-base-addr.exp Tom de Vries
@ 2023-08-10 13:49 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2023-08-10 13:49 UTC (permalink / raw)
  To: gdb-patches

When running test-case gdb.dwarf2/enqueued-cu-base-addr.exp with target board
cc-with-gnu-debuglink, I run into:
...
(gdb) PASS: gdb.dwarf2/enqueued-cu-base-addr.exp: ptype foo
maint print symbols -objfile enqueued-cu-base-addr^M
(gdb) FAIL: gdb.dwarf2/enqueued-cu-base-addr.exp: CU addr found
...

The problem is that the CU we're trying to print is in objfile
enqueued-cu-base-addr.debug instead of enqueued-cu-base-addr.

Fix this by replacing "-objfile enqueued-cu-base-addr" with "-source cu2".

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
index 9b2d1d87362..c44cfd1a81b 100644
--- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
@@ -97,7 +97,7 @@ set cu2_blockvector_re \
 	 "" \
 	 "block #000, \[^\r\n\]* in ($hex)..$hex" \
 	 ".*"]
-gdb_test_multiple "maint print symbols -objfile $testfile" "CU addr found" {
+gdb_test_multiple "maint print symbols -source cu2" "CU addr found" {
     -re -wrap $cu2_blockvector_re {
 	set addr $expect_out(1,string)
 	if { $addr eq "0x0" } {
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-10 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10 13:49 [pushed] [gdb/testsuite] Improve failure mode in gdb.dwarf2/enqueued-cu-base-addr.exp Tom de Vries
2023-08-10 13:49 ` [pushed] [gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp with cc-with-gnu-debuglink Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).