From fc238d4a066cdb1a979475ffdf5bd45cdb8a00f0 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 9 Jul 2020 09:39:05 -0700 Subject: Support several new ELF auxiliary vector types on FreeBSD. FreeBSD's kernel recently added several ELF auxiliary vector entries to describe the arguments passed to new executable images during exec(). The AT_FREEBSD_ARGC and AT_FREEBSD_ARGV entries give the length and address of the process argument array. AT_FREEBSD_ENVC and AT_FREEBSD_ENVV entries give the length and address of the initial process environment. AT_FREEBSD_PS_STRINGS gives the address of the 'struct ps_strings' object. include/ChangeLog: * elf/common.h (AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC) (AT_FREEBSD_ENVV, AT_FREEBSD_PS_STRINGS): Define. gdb/ChangeLog: * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC, AT_FREEBSD_ENVV, AT_FREEBSD_PS_STRINGS. --- gdb/fbsd-tdep.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/fbsd-tdep.c') diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index acf787c..557c5d3 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -1598,6 +1598,11 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX); TAG (HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX); TAG (BSDFLAGS, _("ELF BSD flags"), AUXV_FORMAT_HEX); + TAG (ARGC, _("Argument count"), AUXV_FORMAT_DEC); + TAG (ARGV, _("Argument vector"), AUXV_FORMAT_HEX); + TAG (ENVC, _("Environment count"), AUXV_FORMAT_DEC); + TAG (ENVV, _("Environment vector"), AUXV_FORMAT_HEX); + TAG (PS_STRINGS, _("Pointer to ps_strings"), AUXV_FORMAT_HEX); } fprint_auxv_entry (file, name, description, format, type, val); -- cgit v1.1