From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122951 invoked by alias); 21 Jun 2019 14:45:39 -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 122463 invoked by uid 89); 21 Jun 2019 14:45:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Jun 2019 14:45:24 +0000 Received: by mail-wm1-f67.google.com with SMTP id s3so6567955wms.2 for ; Fri, 21 Jun 2019 07:45:17 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4c97:6d52:2cea:997b? ([2001:8a0:f913:f700:4c97:6d52:2cea:997b]) by smtp.gmail.com with ESMTPSA id f204sm4145853wme.18.2019.06.21.07.45.14 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 07:45:14 -0700 (PDT) Subject: Re: [PATCH 3/4] Allow display of negative offsets in print_address_symbolic() To: Kevin Buettner , gdb-patches@sourceware.org References: <20190608195434.26512-1-kevinb@redhat.com> <20190608195434.26512-4-kevinb@redhat.com> From: Pedro Alves Message-ID: Date: Fri, 21 Jun 2019 14:45: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: <20190608195434.26512-4-kevinb@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00425.txt.bz2 On 6/8/19 8:54 PM, Kevin Buettner wrote: > When examining addresses associated with blocks with non-contiguous > address ranges, it's not uncommon to see large positive offsets which, > for some address width, actually represent a smaller negative offset. > Here's an example taken from the test case: > > (gdb) x/i foo_cold > 0x40110d : push %rbp > > This commit causes cases like the above to be displayed like this (below) > instead: > > (gdb) x/i foo_cold > 0x40110d : push %rbp > > gdb/ChangeLog: > > * printcmd.c (print_address_symbolic): Print negative offsets. > (build_address_symbolic): Force signed arithmetic when computing > offset. Seems reasonable to me, if we assume that the symbol name to put within <> is "foo". This change makes makes me doubt that, though. We're looking at the lower level, disassembly code. I think I'd want to see 0x40110d : there? E.g., I might want to follow up with disassemble foo_cold. But the present state of things, I wouldn't be able to see the foo_cold symbol, where it starts? Maybe a larger disassemble output including several cold sections in view would help determine the best output. Thanks, Pedro Alves