Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH 3/4] Allow display of negative offsets in print_address_symbolic()
Date: Thu, 04 Jul 2019 01:06:00 -0000	[thread overview]
Message-ID: <20190703180558.509e1bad@f29-4.lan> (raw)
In-Reply-To: <20190703160921.0ad37a42@f29-4.lan>

On Wed, 3 Jul 2019 16:09:21 -0700
Kevin Buettner <kevinb@redhat.com> wrote:

> When I say "x/i foo_cold", I do think I'd prefer to see <foo_cold> instead
> of <foo-19>.
> 
> 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 <foo_cold>:	push   %rbp
>    0x40110e <foo-18>:	mov    %rsp,%rbp
>    0x401111 <foo-15>:	callq  0x401106 <baz>
> => 0x401116 <foo-10>:	nop  
>    0x401117 <foo-9>:	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 <foo-19> <foo_cold>: push   %rbp
>    0x40110e <foo-18>:	mov    %rsp,%rbp
>    0x401111 <foo-15>:	callq  0x401106 <baz>
> => 0x401116 <foo-10>:	nop  
>    0x401117 <foo-9>:	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


  reply	other threads:[~2019-07-04  1:06 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 4/4] Improve test gdb.dwarf2/dw2-ranges-func.exp Kevin Buettner
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 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 3/4] Allow display of negative offsets in print_address_symbolic() Kevin Buettner
2019-06-21 14:45   ` Pedro Alves
2019-07-03 23:09     ` Kevin Buettner
2019-07-04  1:06       ` Kevin Buettner [this message]
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=20190703180558.509e1bad@f29-4.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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