From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>, Tom de Vries <tdevries@suse.de>
Subject: [PATCH 0/2] Fix missing print frame when stepping out of function
Date: Sun, 5 Apr 2026 11:12:05 +0100 [thread overview]
Message-ID: <cover.1775383137.git.aburgess@redhat.com> (raw)
In-Reply-To: <20260331132342.1050954-1-tdevries@suse.de>
Hi Tom,
I looked into the regression you saw with gdb.opt/inline-cmds.exp, and
read your notes. 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". 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.
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. 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.
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?
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.
Take a look through, and let me know what you think.
Thanks,
Andrew
---
Andrew Burgess (1):
gdb: use get_current_frame consistently in print_stop_location
Tom de Vries (1):
gdb: fix missing print frame when stepping out of function
gdb/gdbthread.h | 36 ++++++++++++++-
gdb/infcmd.c | 3 +-
gdb/infrun.c | 20 ++++-----
.../gdb.dwarf2/dw2-extend-inline-block.exp | 45 +++++++++++++++++--
gdb/testsuite/gdb.opt/inline-cmds.exp | 33 +++++++++-----
5 files changed, 108 insertions(+), 29 deletions(-)
base-commit: 9d3cf9efd51ebae3f45bb49e3544cb7eeb63a138
--
2.25.4
next prev parent reply other threads:[~2026-04-05 10:12 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 ` Andrew Burgess [this message]
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 ` [PATCH 0/2] Fix " Tom de Vries
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=cover.1775383137.git.aburgess@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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