[PATCH v4 11/14] xfail gdb.base/coredump-filter.exp test which now works without a binary

Kevin Buettner kevinb@redhat.com
Sun Jul 5 22:58:04 GMT 2020


See comment in patch for a description of what this is about.  In
a nutshell, a certain memory access was expected to not work in
order to PASS, but due to recent changes, the memory access now
works causing the test to FAIL.

gdb/testsuite/ChangeLog:

	* gdb.base/coredump-filter.exp (test_disasm):  Call
	setup_xfail for test "disassemble function with corefile and
	without a binary".
---
 gdb/testsuite/gdb.base/coredump-filter.exp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index ff398f2b85..fd4e0352d8 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -96,6 +96,27 @@ proc test_disasm { core address should_fail } {
 	}
 
 	if { $should_fail == 1 } {
+	    # As originally conceived, an attempt here to disassemble
+	    # addresses in main() with the core file loaded, but with
+	    # the executable not loaded shouldn't work .  This was a
+	    # good idea because it demonstrates that executable-backed
+	    # memory was not dumped to the core file.  However, this
+	    # test now fails (i.e. now successfully disassembles
+	    # addresses in main()) due to the fact that GDB loads the
+	    # file-based mappings in Linux's NT_FILE note.  So, even
+	    # though the executable wasn't explicitly loaded, GDB will
+	    # still be able to find the file-backed memory via the
+	    # note (referencing the file) within the core file.  The
+	    # data in question is not actually stored in the core
+	    # file, but is instead found in one of the files mentioned
+	    # in the core file note.
+	    #
+	    # It's tempting to simply remove this test because it's
+	    # apparently no longer useful.  However, the idea behind
+	    # the test is useful, so it's marked as xfail, along with
+	    # this comment, as a reminder for someone to come up with
+	    # a new approach.
+	    setup_xfail "*-*-*"
 	    gdb_test "x/i \$pc" "=> $hex:\tCannot access memory at address $hex" \
 		"disassemble function with corefile and without a binary"
 	} else {
-- 
2.26.2



More information about the Gdb-patches mailing list