From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73051 invoked by alias); 4 Jul 2019 01:06:01 -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 73042 invoked by uid 89); 4 Jul 2019 01:06:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 01:05:59 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA45B307D913 for ; Thu, 4 Jul 2019 01:05:58 +0000 (UTC) Received: from f29-4.lan (ovpn-117-224.phx2.redhat.com [10.3.117.224]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A053460BE0; Thu, 4 Jul 2019 01:05:58 +0000 (UTC) Date: Thu, 04 Jul 2019 01:06:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: [PATCH 3/4] Allow display of negative offsets in print_address_symbolic() Message-ID: <20190703180558.509e1bad@f29-4.lan> In-Reply-To: <20190703160921.0ad37a42@f29-4.lan> References: <20190608195434.26512-1-kevinb@redhat.com> <20190608195434.26512-4-kevinb@redhat.com> <20190703160921.0ad37a42@f29-4.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00082.txt.bz2 On Wed, 3 Jul 2019 16:09:21 -0700 Kevin Buettner wrote: > When I say "x/i foo_cold", I do think I'd prefer to see instead > of . > > However, when I do "x/5i $pc" after doing "up" from the baz frame, I think > I somewhat prefer seeing foo with negative offsets. > > What would you think about this behavior? > > (gdb) x/5i foo_cold > 0x40110d : push %rbp > 0x40110e : mov %rsp,%rbp > 0x401111 : callq 0x401106 > => 0x401116 : nop > 0x401117 : pop %rbp > > I.e. prefer the minsym for offset 0, but use the function symbol for > the non-zero offsets. For the v2 version of this series, I've implemented the behavior shown above. I (hopefully) provide a good rationale for this behavior in the commit comment. (So, if you don't immediately like it, stay tuned for the v2 patch series.) > Another possibility: > > (gdb) x/5i foo_cold > 0x40110d : push %rbp > 0x40110e : mov %rsp,%rbp > 0x401111 : callq 0x401106 > => 0x401116 : nop > 0x401117 : pop %rbp > > I.e, show both the function symbol (plus/minus offset) AND the minsym, > but only show the minsym for the zero offset. > > I haven't tried implementing either of these approaches yet, but > I can take a look at it if we have some concensus over what the output > should look like. I sort of like this one too, but it's harder to implement, causes some of the lines to be longer, and will also make it less likely that all of the instructions associated with a given function will line up. Kevin