diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-04-12 02:00:14 +0200 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-04-12 13:06:08 +0200 |
commit | 54b8cbd0e4063846349634aefa8ed1a3c0ac62ca (patch) | |
tree | 3deec11e19aac2982654f8c2550d10680527ca7f /gdb/nbsd-nat.h | |
parent | 0b07a199018c928f12ddfb8d5f75baf466de389d (diff) | |
download | binutils-gdb-54b8cbd0e4063846349634aefa8ed1a3c0ac62ca.tar.gz |
Implement "info proc mappings" for NetBSD
Define nbsd_nat_target::find_memory_regions and
nbsd_nat_target::info_proc. info_proc handles as of now only
the "mappings" command.
Define a local static function kinfo_get_vmmap() that reads
the process memory layout of a specified process.
kinfo_get_vmmap() wraps the sysctl(3) call.
nbsd-tdep.c defines now utility functions for printing the
process memory layout:
* nbsd_info_proc_mappings_header()
* nbsd_vm_map_entry_flags()
* nbsd_info_proc_mappings_entry()
gdb/ChangeLog:
* nbsd-nat.c; Include "nbsd-tdep.h" and "gdbarch.h".
* nbsd-nat.c (nbsd_nat_target::find_memory_regions)
(nbsd_nat_target::info_proc): New functions.
* nbsd-nat.c (kinfo_get_vmmap): New function.
* nbsd-nat.c (nbsd_nat_target::info_proc) Use
nbsd_info_proc_mappings_header and nbsd_info_proc_mappings_entry.
* nbsd-tdep.c (nbsd_info_proc_mappings_header)
(nbsd_info_proc_mappings_entry, nbsd_vm_map_entry_flags): New
functions.
* nbsd-tdep.c (KINFO_VME_PROT_READ, KINFO_VME_PROT_WRITE)
(KINFO_VME_PROT_EXEC, KINFO_VME_FLAG_COW)
(KINFO_VME_FLAG_NEEDS_COPY, KINFO_VME_FLAG_NOCOREDUMP)
(KINFO_VME_FLAG_PAGEABLE, KINFO_VME_FLAG_GROWS_UP)
(KINFO_VME_FLAG_GROWS_DOWN): New.
Diffstat (limited to 'gdb/nbsd-nat.h')
-rw-r--r-- | gdb/nbsd-nat.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/nbsd-nat.h b/gdb/nbsd-nat.h index 3606048cd07..256db4b9017 100644 --- a/gdb/nbsd-nat.h +++ b/gdb/nbsd-nat.h @@ -35,6 +35,9 @@ struct nbsd_nat_target : public inf_ptrace_target void post_attach (int pid) override; void update_thread_list () override; std::string pid_to_str (ptid_t ptid) override; + + int find_memory_regions (find_memory_region_ftype func, void *data) override; + bool info_proc (const char *, enum info_proc_what) override; }; #endif /* nbsd-nat.h */ |