aboutsummaryrefslogtreecommitdiff
path: root/gdb/fbsd-tdep.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-10-26 10:20:56 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2018-10-26 10:20:56 -0700
commitfd2b4de5e63ad5994baf9c57b5d0c49d1f1dd4e4 (patch)
tree8dc58e9e55e40f006464c58682dabaa1e57beee9 /gdb/fbsd-tdep.c
parentd7ded98f4cf9891cf04fe6af5c90b6af6709dff8 (diff)
downloadgdb-fd2b4de5e63ad5994baf9c57b5d0c49d1f1dd4e4.zip
gdb-fd2b4de5e63ad5994baf9c57b5d0c49d1f1dd4e4.tar.gz
gdb-fd2b4de5e63ad5994baf9c57b5d0c49d1f1dd4e4.tar.bz2
Treat all unknown auxv tags on FreeBSD as unknown.
Previously, default_print_auxv_entry was called for any auxv entries without a known AT_FREEBSD_* tag. However, this resulted in false positive matches when FreeBSD added a new tag that has an existing AT_* tag with a different meaning. Instead, only call default_print_auxv_entry for specific tag values for which FreeBSD matches the default AT_* values. gdb/ChangeLog: * fbsd-tdep.c (fbsd_print_auxv_entry): Only use default_print_auxv_entry for specific tag values.
Diffstat (limited to 'gdb/fbsd-tdep.c')
-rw-r--r--gdb/fbsd-tdep.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index 4e9ea81..db9a217 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -1500,12 +1500,29 @@ static void
fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
CORE_ADDR type, CORE_ADDR val)
{
- const char *name;
- const char *description;
- enum auxv_format format;
+ const char *name = "???";
+ const char *description = "";
+ enum auxv_format format = AUXV_FORMAT_HEX;
switch (type)
{
+ case AT_NULL:
+ case AT_IGNORE:
+ case AT_EXECFD:
+ case AT_PHDR:
+ case AT_PHENT:
+ case AT_PHNUM:
+ case AT_PAGESZ:
+ case AT_BASE:
+ case AT_FLAGS:
+ case AT_ENTRY:
+ case AT_NOTELF:
+ case AT_UID:
+ case AT_EUID:
+ case AT_GID:
+ case AT_EGID:
+ default_print_auxv_entry (gdbarch, file, type, val);
+ return;
#define _TAGNAME(tag) #tag
#define TAGNAME(tag) _TAGNAME(AT_##tag)
#define TAG(tag, text, kind) \
@@ -1522,9 +1539,6 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
TAG (EHDRFLAGS, _("ELF header e_flags"), AUXV_FORMAT_HEX);
TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX);
TAG (HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX);
- default:
- default_print_auxv_entry (gdbarch, file, type, val);
- return;
}
fprint_auxv_entry (file, name, description, format, type, val);