Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 5/6] gdb: remove embedded_offset argument that is always 0
Date: Wed, 13 May 2026 09:27:43 -0600	[thread overview]
Message-ID: <87lddnl47k.fsf@tromey.com> (raw)
In-Reply-To: <1281d9563073d028c50690fa26bbe165b9c7beff.1778579473.git.aburgess@redhat.com> (Andrew Burgess's message of "Tue, 12 May 2026 11:07:26 +0100")

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> But it turns out that the only value that is ever passed to this
Andrew> function is zero.

Andrew> I believe that, like the last commit, the embedded_offset is actually
Andrew> representing the offset of a field within a value.  However, in all of
Andrew> the use cases, the "field" being accessed is the entire value, hence
Andrew> why we always pass 0, we are asking about the whole value starting
Andrew> from the very beginning.

Andrew> Given this, I couldn't bring myself to rename the argument.  Let's just
Andrew> remove it.  It turns out that there's a bunch of functions in
Andrew> valprint.c that take an argument called embedded_offset, which are
Andrew> always zero.

Andrew> This commit removes the argument, and updates the code to assume zero.

Looks good, thanks.

I've often wondered if the "embedded offset" stuff could be removed from
value.

Anyway
Approved-By: Tom Tromey <tom@tromey.com>

Tom

  reply	other threads:[~2026-05-13 15:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 10:07 [PATCH 0/6] Fix aggregate types, synthetic pointers, and computed locations bug Andrew Burgess
2026-05-12 10:07 ` [PATCH 1/6] gdb: int to bool conversion in valprint.{c,h} Andrew Burgess
2026-05-13 14:48   ` Tom Tromey
2026-05-12 10:07 ` [PATCH 2/6] gdb: use TARGET_CHAR_BIT more in dwarf2/expr.c Andrew Burgess
2026-05-13 15:05   ` Tom Tromey
2026-05-15 12:00     ` Andrew Burgess
2026-05-15 14:44       ` Tom Tromey
2026-05-12 10:07 ` [PATCH 3/6] gdb: fix coerce_pieced_ref for multi-piece values Andrew Burgess
2026-05-14 18:53   ` Tom Tromey
2026-05-12 10:07 ` [PATCH 4/6] gdb: rename argument in valprint_check_validity Andrew Burgess
2026-05-13 16:23   ` Tom Tromey
2026-05-12 10:07 ` [PATCH 5/6] gdb: remove embedded_offset argument that is always 0 Andrew Burgess
2026-05-13 15:27   ` Tom Tromey [this message]
2026-05-12 10:07 ` [PATCH 6/6] gdb: use value::embedded_offset in check_pieced_synthetic_pointer Andrew Burgess
2026-05-14 19:00   ` Tom Tromey

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=87lddnl47k.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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