Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH] gdb: fixes for DW_OP_entry_value when inferior is at entry point
Date: Thu, 03 Sep 2026 16:41:45 +0100	[thread overview]
Message-ID: <87jyp2s5om.fsf@redhat.com> (raw)
In-Reply-To: <87y0dj4ga3.fsf@tromey.com>

Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> This fixes some issues with DW_OP_entry_value which are discussed in
> Andrew> PR gdb/34571.
>
> Thanks for doing this.
>
> Andrew> To understand the fix for this bug we need to first revisit the
> Andrew> earlier commit that introduced the bug:
>
> Andrew>   commit 1bafda2c4595f0f936a5845caf9667b70b198091
> Andrew>   Date:   Wed Apr 9 12:02:18 2025 +0200
>
> Andrew>       [gdb/symtab] Handle DW_OP_entry_value at function entry
>
> I appreciate the research and commentary as well.
>
> Looking at this code, I don't really follow why there's even such a
> large special case for trivial_entry_value.  It seems like the code
> could be much simpler: when seeing a DW_OP_entry_value, evaluate the
> entry value expression in the target frame -- either the parent frame,
> or for the trivial_entry_value case, the current frame.
>
> That is, these special checks and calls to dwarf_block_to_dwarf_reg and
> dwarf_block_to_dwarf_reg_deref (which to be clear predate the
> trivial_entry_value patch) also seem totally unnecessary, as does this
> restriction:
>
> 	    error (_("DWARF-2 expression error: DW_OP_entry_value is "
> 		     "supported only for single DW_OP_reg* "
> 		     "or for DW_OP_breg*(0)+DW_OP_deref*"));
>
> That said, I don't think there's anything wrong with an improvement that
> doesn't rewrite it all.  And anyway maybe there's some subtlety I don't
> understand.
>
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks Tom.

I pushed this patch to master and gdb-18-branch.

I also have a follow on patch which is in testing now, that refactors
this code inline with your suggestion above.

I decided to push the first patch as the change here is smaller, and
especially for the gdb-18-branch, it seemed lower risk.  The refactor,
once I post it, would only be for master.

Thanks,
Andrew


      reply	other threads:[~2026-09-03 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 21:04 Andrew Burgess
2026-09-02 19:14 ` Tom Tromey
2026-09-03 15:41   ` Andrew Burgess [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=87jyp2s5om.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    --cc=tom@tromey.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