From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112669 invoked by alias); 12 Aug 2019 15:37:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 112661 invoked by uid 89); 12 Aug 2019 15:37:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*gdb-patches, H*r:4.82 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Aug 2019 15:37:40 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hxCOA-0007PR-1K; Mon, 12 Aug 2019 11:37:38 -0400 Received: from [176.228.60.248] (port=4587 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hxCO7-0004EU-OL; Mon, 12 Aug 2019 11:37:36 -0400 Date: Mon, 12 Aug 2019 15:37:00 -0000 Message-Id: <83zhkes8cu.fsf@gnu.org> From: Eli Zaretskii To: Alan Hayward CC: gdb-patches@sourceware.org, nd@arm.com In-reply-to: <20190812151349.61011-1-alan.hayward@arm.com> (message from Alan Hayward on Mon, 12 Aug 2019 15:13:52 +0000) Subject: Re: [PATCH] Move [PAC] into a new MI field addr_flags References: <20190812151349.61011-1-alan.hayward@arm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00245.txt.bz2 > From: Alan Hayward > CC: nd , Alan Hayward > Date: Mon, 12 Aug 2019 15:13:52 +0000 > > Add a new print_pc which prints both the PC and a new field addr_flags. > Call this wherever the PC is printed in stack.c. > > Add a new gdbarch method get_pc_address_flags to obtain the addr_flag > contents. By default returns an empty string, on AArch64 this returns > PAC if the address has been masked in the frame. > > Document this in the manual and NEWS file. > > gdb/ChangeLog: > > 2019-08-12 Alan Hayward > > * NEWS (Other MI changes): New subsection. > * aarch64-tdep.c (aarch64_get_pc_address_flags): New function. > (aarch64_gdbarch_init): Add aarch64_get_pc_address_flags. > * arch-utils.c (default_get_pc_address_flags): New function. > * arch-utils.h (default_get_pc_address_flags): New declaration. > * gdbarch.sh: Add get_pc_address_flags. > * gdbarch.c: Regenerate. > * gdbarch.h: Likewise. > * stack.c (print_pc): New function. > (print_frame_info) (print_frame): Call print_pc. > > gdb/doc/ChangeLog: > > 2019-08-12 Alan Hayward > > * gdb.texinfo (AArch64 Pointer Authentication) > (GDB/MI Breakpoint Information) (Frame Information): Document > addr_field. > --- > gdb/NEWS | 6 ++++++ > gdb/aarch64-tdep.c | 13 +++++++++++++ > gdb/arch-utils.c | 8 ++++++++ > gdb/arch-utils.h | 4 ++++ > gdb/doc/gdb.texinfo | 18 +++++++++++++++++- > gdb/gdbarch.c | 23 +++++++++++++++++++++++ > gdb/gdbarch.h | 6 ++++++ > gdb/gdbarch.sh | 3 +++ > gdb/stack.c | 29 ++++++++++++++++++++--------- > 9 files changed, 100 insertions(+), 10 deletions(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index fa01adf6e8..42b2ba3d2b 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -287,6 +287,12 @@ maint show test-options-completion-result > These can be used to catch C++ exceptions in a similar fashion to > the CLI commands 'catch throw', 'catch rethrow', and 'catch catch'. > > +* Other MI changes > + > + ** Backtraces and frames include a new optional field addr_flags which is > + given after the addr field. Currently this is only used by AArch64 > + for indicating PAC encyrpted addresses. I think your original description at the beginning of your message describes the purpose of this field more clearly. Also, "encyrpted" is a typo. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -24397,7 +24397,8 @@ When @value{GDBN} is debugging the AArch64 architecture, and the program is > using the v8.3-A feature Pointer Authentication (PAC), then whenever the link > register @code{$lr} is pointing to an PAC function its value will be masked. > When GDB prints a backtrace, any addresses that required unmasking will be > -postfixed with the marker [PAC]. > +postfixed with the marker [PAC]. When using the MI, this is printed as part > +of the @code{addr_flags}. field ^ That period should be moved to after "field". > +@item addr_flags > +Optional field containing any flags related to the address. If there > +are any flags defined for the current target then they are documented in > +the @xref{Architectures} section. I suggest to reword: These flags are architecture-dependent; see @ref{Architectures} for their meaning for a particular CPU. Thanks.