]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Support 'info proc' for FreeBSD process core dumps.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2018 21:35:17 +0000 (13:35 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2018 21:35:17 +0000 (13:35 -0800)
commitd2176225dc982c22640215a0e611e997e8eeb030
tree3fbfad21e9f1df443eca7e421b2b31b4ca521639
parent74ccf6db1188b7b05c716f8382d28b276ec578ec
Support 'info proc' for FreeBSD process core dumps.

- Command line arguments are obtained from the pr_psargs[] array
  saved in the NT_PRPSINFO note.
- The 'cwd' and 'exe' values are obtained from the per-process file
  descriptor table stored in the NT_PROCSTAT_FILES core note.
- 'mappings' is implemented by walking the array of VM map entries
  stored in the NT_PROCSTAT_VMMAP core note.
- 'status' output is generated by outputting fields from
  the first structure stored in the NT_PROCSTAT_PROC core note.
- 'stat' is aliased to 'status'.

gdb/ChangeLog:

* fbsd-tdep.c (KVE_STRUCTSIZE, KVE_START, KVE_END, KVE_OFFSET)
(KVE_FLAGS, KVE_PROTECTION, KVE_PATH, 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_SUPER, KINFO_VME_FLAG_GROWS_UP)
(KINFO_VME_FLAG_GROWS_DOWN, KF_STRUCTSIZE, KF_TYPE, KF_FD)
(KF_PATH, KINFO_FILE_TYPE_VNODE, KINFO_FILE_FD_TYPE_CWD)
(KINFO_FILE_FD_TYPE_TEXT, SIG_WORDS, struct kinfo_proc_layout)
(kinfo_proc_layout_32, kinfo_proc_layout_i386)
(kinfo_proc_layout_64, fbsd_vm_map_entry_flags)
(fbsd_core_info_proc_mappings, fbsd_core_vnode_path)
(fbsd_core_fetch_timeval, fbsd_print_sigset)
(fbsd_core_info_proc_status, fbsd_core_info_proc): New.
(fbsd_init_abi):  Install gdbarch "core_info_proc" method.
* fbsd-tdep.h (fbsd_vm_map_entry_flags): New.
gdb/ChangeLog
gdb/fbsd-tdep.c
gdb/fbsd-tdep.h