+2020-07-22 Kevin Buettner <kevinb@redhat.com>
+
+ * linux-tdep.c (dump_note_entry_p): New function.
+ (linux_dump_mapping_p_ftype): New typedef.
+ (linux_find_memory_regions_full): Add new parameter,
+ should_dump_mapping_p.
+ (linux_find_memory_regions): Adjust call to
+ linux_find_memory_regions_full.
+ (linux_make_mappings_core_file_notes): Use dump_note_entry_p in
+ call to linux_find_memory_regions_full.
+
2020-07-22 Kevin Buettner <kevinb@redhat.com>
* corelow.c (solist.h, unordered_map): Include.
+2020-07-22 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/coredump-filter.exp: Add second
+ non-Private-Shared-Anon-File test.
+ (test_disasm): Rename binfile for test which is expected
+ to fail.
+
2020-07-22 Kevin Buettner <kevinb@redhat.com>
* gdb.base/corefile.exp: Add test "accessing read-only mmapped
# disassemble of a function (i.e., the binary's .text section). GDB
# should fail in this case. However, it must succeed if the binary is
# provided along with the corefile. This is what we test here.
+#
+# A further complication is that Linux NT_FILE notes are now read from
+# the corefile. This note allows GDB to find the binary for file
+# backed mappings even though the binary wasn't loaded by GDB in the
+# conventional manner. In order to see the expected failure for this
+# case, we rename the binary in order to perform this test.
proc test_disasm { core address should_fail } {
- global testfile hex
+ global testfile hex binfile
# Restart GDB without loading the binary.
with_test_prefix "no binary" {
gdb_exit
gdb_start
+ set hide_binfile [standard_output_file "${testfile}.hide"]
+ if { $should_fail == 1 } {
+ remote_exec host "mv -f $binfile $hide_binfile"
+ }
+
set core_loaded [gdb_core_cmd "$core" "load core"]
if { $core_loaded == -1 } {
fail "loading $core"
}
if { $should_fail == 1 } {
+ remote_exec host "mv -f $hide_binfile $binfile"
gdb_test "x/i \$pc" "=> $hex:\tCannot access memory at address $hex" \
"disassemble function with corefile and without a binary"
} else {
}
with_test_prefix "loading and testing corefile for non-Private-Shared-Anon-File" {
+ test_disasm $non_private_shared_anon_file_core $main_addr 0
+}
+
+with_test_prefix "loading and testing corefile for non-Private-Shared-Anon-File with renamed binary" {
test_disasm $non_private_shared_anon_file_core $main_addr 1
}