From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36973 invoked by alias); 8 Aug 2019 10:33:52 -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 36964 invoked by uid 89); 8 Aug 2019 10:33:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 10:33:50 +0000 Received: by mail-wm1-f68.google.com with SMTP id v19so1875462wmj.5 for ; Thu, 08 Aug 2019 03:33:50 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id y16sm201467296wrg.85.2019.08.08.03.33.48 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 03:33:48 -0700 (PDT) Subject: Re: [PATCH V2] AArch64 pauth: Indicate unmasked addresses in backtrace To: Alan Hayward References: <20190730144123.11135-1-alan.hayward@arm.com> <728af5fa-8e3d-845c-d72f-60b1d2067643@redhat.com> Cc: "gdb-patches@sourceware.org" , nd From: Pedro Alves Message-ID: <474e8e87-50d4-874f-787f-ef5f5fbb6cc3@redhat.com> Date: Thu, 08 Aug 2019 10:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-08/txt/msg00193.txt.bz2 On 8/8/19 9:55 AM, Alan Hayward wrote: > gdb/doc/ChangeLog: > > 2019-08-08 Alan Hayward > > * 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", "", > ... 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