This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/6] Add a gdbarch 'print_auxv' method for FreeBSD ABIs.
- From: Pedro Alves <palves at redhat dot com>
- To: John Baldwin <jhb at FreeBSD dot org>, gdb-patches at sourceware dot org, binutils at sourceware dot org
- Date: Tue, 21 Jun 2016 00:43:22 +0100
- Subject: Re: [PATCH 6/6] Add a gdbarch 'print_auxv' method for FreeBSD ABIs.
- Authentication-results: sourceware.org; auth=none
- References: <20160616060202 dot 63470-1-jhb at FreeBSD dot org> <20160616060202 dot 63470-7-jhb at FreeBSD dot org>
On 06/16/2016 07:02 AM, John Baldwin wrote:
>
> +static int
> +fbsd_print_auxv (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type,
> + CORE_ADDR val)
Missing intro comment.
> +{
> + const char *name;
> + const char *description;
> + enum auxv_format flavor;
> +
> + switch (type)
> + {
> +#define _TAGNAME(tag) #tag
> +#define TAGNAME(tag) _TAGNAME(AT_##tag)
> +#define TAG(tag, text, kind) \
> + case AT_FREEBSD_##tag: name = TAGNAME(tag); description = text; flavor = kind; break
> + TAG (EXECPATH, _("Executable path"), str);
> + TAG (CANARY, _("Canary for SSP"), hex);
> + TAG (CANARYLEN, ("Length of the SSP canary"), dec);
> + TAG (OSRELDATE, _("OSRELDATE"), dec);
> + TAG (NCPUS, _("Number of CPUs"), dec);
> + TAG (PAGESIZES, _("Pagesizes"), hex);
> + TAG (PAGESIZESLEN, _("Number of pagesizes"), dec);
> + TAG (TIMEKEEP, _("Pointer to timehands"), hex);
> + TAG (STACKPROT, _("Initial stack protection"), hex);
> + default:
> + return (0);
Write:
return 0;
However, with the suggestion in the previous patch, this would
be a direct call to default_print_auxv_entry.
> + }
> +
> + fprint_single_auxv (file, name, description, flavor, type, val);
> + return (1);
return 1;
Thanks,
Pedro Alves