static bool
dump_note_entry_p (filter_flags filterflags, const smaps_data &map)
{
+ /* No NT_FILE entry for mappings with no filename. */
+ 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]")
}
typedef int linux_find_memory_region_ftype (ULONGEST vaddr, ULONGEST size,
- ULONGEST offset, ULONGEST inode,
+ ULONGEST offset,
int read, int write,
int exec, int modified,
bool memory_tagged,
if (should_dump_mapping_p (filterflags, map))
{
func (map.start_address, map.end_address - map.start_address,
- map.offset, map.inode, map.read, map.write, map.exec,
+ map.offset, map.read, map.write, map.exec,
1, /* MODIFIED is true because we want to dump
the mapping. */
map.vmflags.memory_tagging != 0,
static int
linux_find_memory_regions_thunk (ULONGEST vaddr, ULONGEST size,
- ULONGEST offset, ULONGEST inode,
+ ULONGEST offset,
int read, int write, int exec, int modified,
bool memory_tagged,
const char *filename, void *arg)
static int
linux_make_mappings_callback (ULONGEST vaddr, ULONGEST size,
- ULONGEST offset, ULONGEST inode,
+ ULONGEST offset,
int read, int write, int exec, int modified,
bool memory_tagged,
const char *filename, void *data)
= (struct linux_make_mappings_data *) data;
gdb_byte buf[sizeof (ULONGEST)];
- if (*filename == '\0' || inode == 0)
- return 0;
+ gdb_assert (filename != nullptr && *filename != '\0');
++map_data->file_count;