This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V2] AArch64 pauth: Indicate unmasked addresses in backtrace
- From: Pedro Alves <palves at redhat dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Thu, 8 Aug 2019 11:33:47 +0100
- Subject: Re: [PATCH V2] AArch64 pauth: Indicate unmasked addresses in backtrace
- References: <20190730144123.11135-1-alan.hayward@arm.com> <728af5fa-8e3d-845c-d72f-60b1d2067643@redhat.com> <F3D7A960-329A-4BDA-A251-87828CF3E459@arm.com>
On 8/8/19 9:55 AM, Alan Hayward wrote:
> gdb/doc/ChangeLog:
>
> 2019-08-08 Alan Hayward <alan.hayward@arm.com>
>
> * gdb.texinfo (AArch64 Pointer Authentication): Fix typo.
Please merge this part as obvious.
> I hadn’t realised the implications doing that would have, and had assumed
> you couldn’t add to a field that had already been used.
>
> I had (prematurely) pushed the patch. Is this additional fix ok?
I don't think so,
> diff --git a/gdb/stack.c b/gdb/stack.c
> index 0859815baf..c599caf51c 100644
> --- a/gdb/stack.c
> +++ b/gdb/stack.c
> @@ -1301,7 +1301,7 @@ print_frame (const frame_print_options &fp_opts,
> {
> uiout->field_core_addr ("addr", gdbarch, pc);
> if (get_frame_pc_masked (frame))
> - uiout->field_string ("pac", " [PAC]");
> + uiout->field_string ("addr", " [PAC]");
> }
> else
> uiout->field_string ("addr", "<unavailable>",
>
... because I think that this results in MI printing two different "addr" attributes.
Instead, you'll need to build a string, with e.g., string_printf,
and use uiout->field_string with ui_out_style_kind::ADDRESS style,
so that MI outputs one single "addr" attribute.
Please try "gdb -i=mi". You can still type CLI commands, so just "(gdb) start"
and running to main, so that GDB prints the frame in the *stop event should
be sufficient to trigger this.
BTW, there are two other places where we output the "addr" field
in the file. Do you want to include "[PAC]" in those? If so,
then factoring out the "addr" printing to a separate function
would be appropriate.
Thanks,
Pedro Alves