Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] Allow display of negative offsets in print_address_symbolic()
Date: Fri, 21 Jun 2019 14:45:00 -0000	[thread overview]
Message-ID: <f6b7805e-cb98-2539-72f6-bc10600b8bc8@redhat.com> (raw)
In-Reply-To: <20190608195434.26512-4-kevinb@redhat.com>

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 <foo+4294967277>:	push   %rbp
> 
> This commit causes cases like the above to be displayed like this (below)
> instead:
> 
>     (gdb) x/i foo_cold
>        0x40110d <foo-19>:	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 <foo_cold+0>:

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


  reply	other threads:[~2019-06-21 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-08 19:55 [PATCH 0/4] Non-contiguous address range bug fixes / improvements Kevin Buettner
2019-06-08 19:55 ` [PATCH 3/4] Allow display of negative offsets in print_address_symbolic() Kevin Buettner
2019-06-21 14:45   ` Pedro Alves [this message]
2019-07-03 23:09     ` Kevin Buettner
2019-07-04  1:06       ` Kevin Buettner
2019-06-08 19:55 ` [PATCH 2/4] dwarf2-frame.c: Fix FDE processing bug involving non-contiguous ranges Kevin Buettner
2019-06-21 14:34   ` Pedro Alves
2019-06-08 19:55 ` [PATCH 1/4] Prefer symtab symbol over minsym for function names in non-contiguous blocks Kevin Buettner
2019-06-21 14:26   ` Pedro Alves
2019-06-26 17:30     ` Tom Tromey
2019-07-03 23:16       ` Kevin Buettner
2019-06-08 19:55 ` [PATCH 4/4] Improve test gdb.dwarf2/dw2-ranges-func.exp Kevin Buettner
2019-06-26 17:24 ` [PATCH 0/4] Non-contiguous address range bug fixes / improvements Tom Tromey
2019-07-03 20:10   ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6b7805e-cb98-2539-72f6-bc10600b8bc8@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox