Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 0/2] Fix missing print frame when stepping out of function
Date: Fri, 10 Apr 2026 12:48:04 +0200	[thread overview]
Message-ID: <402237db-6554-4819-95a6-411cf506b798@suse.de> (raw)
In-Reply-To: <cover.1775383137.git.aburgess@redhat.com>

On 4/5/26 12:12 PM, Andrew Burgess wrote:
> Hi Tom,
> 
> I looked into the regression you saw with gdb.opt/inline-cmds.exp, and
> read your notes. 

Hi Andrew,

a massive thanks for helping out with this.

> As you predicted, the issue is that we need to
> better take into account the inline frame state when setting up, and
> checking during, the step/next process.
> 
> Luckily, we already have a mechanism in GDB to do this,
> get_frame_function.  This returns the function symbol for a frame,
> taking into account which frames are inlined but being skipped.
> 
> Assuming a call stack like: 'non-inline function -> inline function'
> the original code was always returning the non-inline function.  My
> initial proposal was always returning the inline function, and the
> reality is neither of these is always correct.
> 
> The get_frame_function returns the function that represents the given
> frame, which is exactly what we want.
> 
> In fact, I did consider the idea that we should move away from
> tracking via the function symbol, and instead just hold a separate
> frame-id for the "original frame when stepping started". 

Yes, I actually had already started working on that approach when I saw 
this series.

> I think this
> would probably work just fine, but currently, if the frame-id changes,
> but the function symbol stays the same then GDB would work a
> particular way, switching to using a frame-id would change this.  I
> doubt this is actually a real concern, but I didn't want to change too
> much in one go, so I'm sticking with function symbol tracking.

I see.

> The gdb.opt/inline-cmds.exp regression you ran into was only visible
> from part of the test that runs in MI mode, but the bug itself would
> manifest in CLI and MI mode, we just didn't spot the bug in CLI mode.
> So I extended the test to reveal the bug in CLI mode too. 

That's a great idea, thanks.

> I expect
> that the bug likely was present in other tests too, but the test
> patterns are too lax, and so didn't trigger for the regression, which
> is a bit of a shame, but I don't have the time right now to track down
> tests that _should_ have failed and fix them, at least we have one
> test that we know checks this stuff now.
I didn't think of that, good point.

> Your new additions to gdb.dwarf2/dw2-extend-inline-block.exp all pass,
> and I've done a full local test run and don't see any other
> regressions.
> 
> Your original RFC patch #1 was no longer needed for this series, but
> you might want to repost that separately as it did have one use
> outside this series, so maybe it's worth having anyway?
> 

OK, I'll do that.

> I folded RFC patch #2 into what is the second patch in this series.  I
> ended up changing the API anyway, so it seemed to make sense to do all
> the changes in a single patch.
> 

I ended up reverting that in v4, I think the fix is more readable with 
infrastructure changes factored out.

> Take a look through, and let me know what you think.

I think v4 is ok to commit.

Thanks,
- Tom

      parent reply	other threads:[~2026-04-10 10:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 13:23 [RFC v2 0/3] [gdb] " Tom de Vries
2026-03-31 13:23 ` [RFC v2 1/3] [gdb/symtab] Add find_symbol_for_pc_maybe_inline Tom de Vries
2026-03-31 13:23 ` [RFC v2 2/3] [gdb] Add thread_control_state::step_start_function methods Tom de Vries
2026-03-31 13:23 ` [RFC v2 3/3] [gdb] Fix missing print frame when stepping out of function Tom de Vries
2026-04-05 10:12 ` [PATCH 0/2] " Andrew Burgess
2026-04-05 10:12   ` [PATCH 1/2] gdb: use get_current_frame consistently in print_stop_location Andrew Burgess
2026-04-09  6:42     ` Tom de Vries
2026-04-09  8:54       ` Andrew Burgess
2026-04-09 13:43         ` Tom de Vries
2026-04-10  8:57           ` Andrew Burgess
2026-04-10 10:17             ` Tom de Vries
2026-04-05 10:12   ` [PATCH 2/2] gdb: fix missing print frame when stepping out of function Andrew Burgess
2026-04-10 10:29     ` Tom de Vries
2026-04-10 10:48   ` Tom de Vries [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=402237db-6554-4819-95a6-411cf506b798@suse.de \
    --to=tdevries@suse.de \
    --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