gcore command: Place all file-backed mappings in NT_FILE note
authorKevin Buettner <kevinb@redhat.com>
Wed, 1 Jul 2020 13:34:50 +0000 (06:34 -0700)
committerKevin Buettner <kevinb@redhat.com>
Wed, 22 Jul 2020 19:47:50 +0000 (12:47 -0700)
commit4ba11f89a259ffa8dc90f4e8d9bca55f2fcb6483
treed84796882ce5658b9175fe41d3479204eee7a88c
parentf9e233c9c465dd4fdbfda4839c45fb624723b604
gcore command: Place all file-backed mappings in NT_FILE note

When making a core file with the GDB's gcore command on Linux,
the same criteria used for determining which mappings should be
dumped were also being used for determining which entries should
be placed in the NT_FILE note.  This is wrong; we want to place
all file-backed mappings in this note.

The predicate function, dump_mapping_p, was used to determine whether
or not to dump a mapping from within linux_find_memory_regions_full.
This commit leaves this predicate in place, but adds a new parameter,
should_dump_mapping_p, to linux_find_memory_regions_full.  It then
calls should_dump_mapping_p instead of dump_mapping_p.  dump_mapping_p
is passed to linux_find_memory_regions_full at one call site; at the
other call site, dump_note_entry_p is passed instead.

gdb/ChangeLog:

* 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.
gdb/linux-tdep.c
This page took 0.023705 seconds and 4 git commands to generate.