This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[testsuite, committed] fix gdb.dwarf2/staticvirtual.exp regexp
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 2 Oct 2015 14:25:56 -0600
- Subject: [testsuite, committed] fix gdb.dwarf2/staticvirtual.exp regexp
- Authentication-results: sourceware.org; auth=none
I saw that gdb.dwarf2/staticvirtual.exp was failing on some bare-metal
targets. This test manufactures some DWARF for a function at address
0x1000, and the regexp was only matching if that address wasn't mapped
on the target. Our hardware nios2-elf test boards don't have memory
mapped there, but the simulator we use for testing does. I also saw
similar failures on arm-none-eabi. On Nios II and ARM GNU/Linux targets
this address is unmapped so the test is passing.
Since it appears that the point of this test is to ensure that GDB
doesn't crash, I don't think there's any actual requirement for the
address to be unmapped, and no reason not to generalize the test to
count any reasonable output as a PASS. So, I've checked in the attached
patch under the obvious fix rule.
-Sandra
2015-10-02 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.dwarf2/staticvirtual.exp: Generalize regexp so it can match
whether or not address 0x1000 is mapped on the target.
diff --git a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
index 06d46e1..dd85b7e 100644
--- a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
+++ b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
@@ -51,4 +51,9 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \
}
# gdb/18021: The test below would cause GDB to crash.
-gdb_test "p S::~S" "0x1000"
+# Depending on whether the target maps memory at address 0x1000,
+# on success this may either print something like
+# $1 = {void (void)} 0x1000 <.*>
+# or
+# Cannot access memory at address 0x1000
+gdb_test "p S::~S" "0x1000.*"