From: John Baldwin <jhb@freebsd.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, binutils@sourceware.org
Subject: Re: [PATCH 5/6] Add a new gdbarch method to print a single AUXV entry.
Date: Thu, 23 Jun 2016 20:19:00 -0000 [thread overview]
Message-ID: <3040586.J8ddLNj11U@ralph.baldwin.cx> (raw)
In-Reply-To: <17933b55-b3e1-51e3-3494-fa35b8cd71fd@redhat.com>
On Tuesday, June 21, 2016 12:40:16 AM Pedro Alves wrote:
> On 06/16/2016 07:02 AM, John Baldwin wrote:
> > Different platforms have different meanings for auxiliary vector
> > entries. The 'print_auxv' gdbarch method allows an architecture
> > to output a suitable description for platform-specific entries.
> >
> > A fprint_single_auxv function is split out of fprint_target_auxv.
> > This function outputs the description of a single auxiliary vector
> > entry to the specified file using caller-supplied formatting and
> > strings to describe the vector type.
> >
> > The existing switch on auxiliary vector types is moved out of
> > fprint_target_auxv into a new default_print_auxv function.
> > default_print_auxv chooses an appropriate format and description
> > and calls fprint_single_auxv to describe a single vector entry.
> >
> > fprint_target_auxv now invokes the gdbarch 'print_auxv' function
> > on each vector entry. If the function is not present or returns
> > zero, default_printf_auxv is called to output a description for
> > the vector.
>
> I like the idea. Though, I think we can simplify this. How about:
>
> - make default_print_auxv be the default gdbarch_print_auxv
> implementation, in gdbarch.sh.
>
> - make fprint_target_auxv calls gdbarch_print_auxv unconditionally.
>
> - remove the support for gdbarch_print_auxv returning 0. Instead,
> implementations that want to defer to default_print_auxv simply
> call it directly.
>
>
> Also, I think it'd be a bit less confusing to rename things like this:
>
> gdbarch_print_auxv -> gdbarch_print_auxv_entry
> default_print_auxv -> default_print_auxv_entry
> fprint_single_auxv -> fprint_auxv_entry
>
> This way methods that print a single entry are consistently named,
> and not so easily confused with methods that print the whole table,
> like fprint_target_auxv.
Agreed, thanks. I've made these changes along with the auxv_format
enum rename and the other issues you've pointed out. Will be posting
a v2 series with those fixes in a bit.
--
John Baldwin
next prev parent reply other threads:[~2016-06-23 20:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 6:02 [PATCH 0/6] Add ELF auxiliary vector handling for FreeBSD John Baldwin
2016-06-16 6:02 ` [PATCH 2/6] Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes John Baldwin
2016-06-17 8:28 ` Nick Clifton
2016-06-16 6:02 ` [PATCH 3/6] Fetch the ELF auxiliary vector from live processes on FreeBSD John Baldwin
2016-06-20 23:01 ` Pedro Alves
2016-06-16 6:02 ` [PATCH 6/6] Add a gdbarch 'print_auxv' method for FreeBSD ABIs John Baldwin
2016-06-20 23:43 ` Pedro Alves
2016-06-16 6:02 ` [PATCH 1/6] Add constants for FreeBSD-specific auxiliary vector entry types John Baldwin
2016-06-17 8:27 ` Nick Clifton
2016-06-16 6:11 ` [PATCH 5/6] Add a new gdbarch method to print a single AUXV entry John Baldwin
2016-06-20 23:40 ` Pedro Alves
2016-06-23 20:19 ` John Baldwin [this message]
2016-06-16 6:11 ` [PATCH 4/6] Create a psuedo section for the ELF AUXV core dump note on FreeBSD John Baldwin
2016-06-17 8:28 ` Nick Clifton
2016-06-20 23:45 ` Pedro Alves
2016-06-20 17:10 ` [PATCH 0/6] Add ELF auxiliary vector handling for FreeBSD John Baldwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3040586.J8ddLNj11U@ralph.baldwin.cx \
--to=jhb@freebsd.org \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox