diff options
Diffstat (limited to 'gdb/linux-tdep.c')
-rw-r--r-- | gdb/linux-tdep.c | 78 |
1 files changed, 7 insertions, 71 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 0b08e12..5c4bbf6 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -805,13 +805,12 @@ dump_note_entry_p (filter_flags filterflags, const smaps_data &map) if (map.filename.length () == 0) return false; - /* Don't add NT_FILE entries for mappings with a zero inode. */ - if (map.inode == 0) - return false; - - /* vDSO and vsyscall mappings will end up in the core file. Don't - put them in the NT_FILE note. */ - if (map.filename == "[vdso]" || map.filename == "[vsyscall]") + /* Special kernel mappings, those with names like '[vdso]' and + '[vsyscall]' will be placed in the core file, but shouldn't get an + NT_FILE entry. These special mappings all have a zero inode. */ + if (map.inode == 0 + && map.filename.front () == '[' + && map.filename.back () == ']') return false; /* Otherwise, any other file-based mapping should be placed in the @@ -3082,9 +3081,7 @@ linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, linux_corefile_parse_exec_context); } -void _initialize_linux_tdep (); -void -_initialize_linux_tdep () +INIT_GDB_FILE (linux_tdep) { /* Observers used to invalidate the cache when needed. */ gdb::observers::inferior_exit.attach (invalidate_linux_cache_inf, @@ -3119,64 +3116,3 @@ more information about this file, refer to the manpage of proc(5) and core(5).") &setlist, &showlist); } - -/* Fetch (and possibly build) an appropriate `link_map_offsets' for - ILP32/LP64 Linux systems which don't have the r_ldsomap field. */ - -link_map_offsets * -linux_ilp32_fetch_link_map_offsets () -{ - static link_map_offsets lmo; - static link_map_offsets *lmp = nullptr; - - if (lmp == nullptr) - { - lmp = &lmo; - - lmo.r_version_offset = 0; - lmo.r_version_size = 4; - lmo.r_map_offset = 4; - lmo.r_brk_offset = 8; - lmo.r_ldsomap_offset = -1; - lmo.r_next_offset = 20; - - /* Everything we need is in the first 20 bytes. */ - lmo.link_map_size = 20; - lmo.l_addr_offset = 0; - lmo.l_name_offset = 4; - lmo.l_ld_offset = 8; - lmo.l_next_offset = 12; - lmo.l_prev_offset = 16; - } - - return lmp; -} - -link_map_offsets * -linux_lp64_fetch_link_map_offsets () -{ - static link_map_offsets lmo; - static link_map_offsets *lmp = nullptr; - - if (lmp == nullptr) - { - lmp = &lmo; - - lmo.r_version_offset = 0; - lmo.r_version_size = 4; - lmo.r_map_offset = 8; - lmo.r_brk_offset = 16; - lmo.r_ldsomap_offset = -1; - lmo.r_next_offset = 40; - - /* Everything we need is in the first 40 bytes. */ - lmo.link_map_size = 40; - lmo.l_addr_offset = 0; - lmo.l_name_offset = 8; - lmo.l_ld_offset = 16; - lmo.l_next_offset = 24; - lmo.l_prev_offset = 32; - } - - return lmp; -} |