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: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Fri, 9 Aug 2019 14:46:28 +0000
- Subject: Re: [PATCH V2] AArch64 pauth: Indicate unmasked addresses in backtrace
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRw1ytLybkIgyBP8MLB6mOKNm94MYZAAPtr76nPzcTo=; b=nCHAki+5GJSuPnDQxbZe5rAolHjoFqhbhrVx8Gl7RuIPfZ57GB3O4jZd3wAdY+UnInwhKtWllDQsyX5prqHREnO7TTPbzV/32j9f9gHfxuxbtqEXtKZ+icoNA75LbUEinVLFy66fWS1GolWZa40VlAxHweol5RH4O8Dx6chNhAD1q+UOyEMsn3wxVsTDwqQGqGxQA/lDWpetIegGW4yEBLFT5se+/TExFKXxrEhuh3dyzEbIC0m1GkTbI6FWFKcF/A/Km2092iFgtK1eHFWJyQBTe1wmOHbx/UdasxG6iMyVpBr8So6JjzCEOK7fL6r0cXcRwbHaFCuF7kFinxW9ug==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SvcrQio+9locak+gUzB+x926YBu0klClFm10Ez1fWqXLaStwKHoRR/2ZcySOGxYxTIGodZE8C3BSzQdGUrk5zdiFE4CCHDRJN5IEfWYzC6qfYboOPJdoFm0zkH9M9rDvYeZtVMNXVmJtLixDJWO1FHMifs060mEKAGKKDvLlebQ3LQtnTt8dbEh7McEdGrwcbKjFKaIg2ZR+o4Z7ndwSnY8s8cLpyd+mWmFZjh0QpnLVnZagf7vt8NhCmNDz7I0q2oy8FgLc0ZpdjhXFN7n2y/LX15VZ9/nLmRooR5Ng/1WDadNU+5KK+Enaq9oeuBY3uXoES311eKEpHnT1GcCGPQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- References: <20190730144123.11135-1-alan.hayward@arm.com> <728af5fa-8e3d-845c-d72f-60b1d2067643@redhat.com> <F3D7A960-329A-4BDA-A251-87828CF3E459@arm.com> <474e8e87-50d4-874f-787f-ef5f5fbb6cc3@redhat.com> <A4E39580-3309-4D26-B0CE-E55EFC89E763@arm.com> <955aee56-6b01-47f6-6870-8d561a2083fc@redhat.com>
> On 9 Aug 2019, at 15:17, Pedro Alves <palves@redhat.com> wrote:
>
> On 8/9/19 2:22 PM, Alan Hayward wrote:
>> It looks like fixing the space just requires an additional call to uiout->text (" “).
>>
>>
>> How about I create a new field addr_flags? It would be a generic field into which
>> targets can add whichever fields they want to.
>>
>> I then could add a call to a new function gdbarch_print_addr_flags() which prints the
>> PAC on AArch64 and nothing on all other targets?
>
> That sounds like two different things. You could have the gdbarch method without
> the uiout field. Not sure what the uiout field buys you. If CLI and MI are going to
> print the same way, then it doesn't appear useful over field_string. The gdbarch
> method sounds fine.
>
I was thinking of the following:
char *flags = gdbarch_print_pc_addr_flags(frame, pc); /* Returns null or “PAC” or “FOO,BAR” etc */
if (flags)
{
uiout->text (“ [“);
uiout->field_string (“addr_flags", flags);
uiout->text (“]“);
}
addr_flags can be printed by any target that wishes. And PAC only needs to be in
AArch64 specifics.
Alan.