Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Zander Work <zdw@google.com>
Cc: gdb-patches@sourceware.org,  guinevere@redhat.com,  tom@tromey.com
Subject: Re: [PATCH v2] Use "output-radix" setting to format function offsets
Date: Wed, 13 May 2026 10:37:29 -0600	[thread overview]
Message-ID: <874ikbl0za.fsf@tromey.com> (raw)
In-Reply-To: <20260509044543.558625-2-zdw@google.com> (Zander Work's message of "Fri, 8 May 2026 21:45:44 -0700")

>>>>> Zander Work <zdw@google.com> writes:

> Updates since v1:
[...]

It's normal in gdb for the commit message to describe the purpose of the
patch.

> +std::string
> +format_pc_offset (int offset)
> +{
> +  std::string sign = (offset < 0) ? "-" : "+";
> +
> +  std::string body = int_string (offset < 0 ? -offset : offset, output_radix,
> +                                 0, 0, 1);

I don't have any objection to this but I wanted to note that using the
output radix is kind of heavy, since it affects all sorts of output.

That is, I tend to think a new option would be preferable.  Though,
unfortunately, that would be more work since it would involve more
documentation at least.

Another possibility is that nobody really even wants decimal here and
that using hex always would be fine.  I mean -- that would be fine by me
but we should see if anyone feels differently.

Finally, I think print_address_symbolic should probably do the same
thing, i.e., it needs an update:

  if (offset != 0)
    gdb_printf (stream, "%+d", offset);

thanks,
Tom

      parent reply	other threads:[~2026-05-13 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  4:45 Zander Work
2026-05-11 14:14 ` Guinevere Larsen
2026-05-12  1:32   ` Zander Work
2026-05-12 11:33     ` Eli Zaretskii
2026-05-12 13:05       ` Zander Work
2026-05-12 13:10         ` Eli Zaretskii
2026-05-14 14:23         ` Simon Marchi
2026-05-14 15:15           ` Zander Work
2026-05-13 16:38       ` Tom Tromey
2026-05-13 16:50         ` Zander Work
2026-05-13 16:37 ` Tom Tromey [this message]

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=874ikbl0za.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=zdw@google.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