From: Eli Zaretskii <eliz@gnu.org>
To: Klaus Gerlicher <klaus.gerlicher@intel.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/1] gdb: remember previously selected thread per inferior
Date: Wed, 25 Mar 2026 16:34:00 +0200 [thread overview]
Message-ID: <867br0x9k7.fsf@gnu.org> (raw)
In-Reply-To: <20260325122321.315910-2-klaus.gerlicher@intel.com> (message from Klaus Gerlicher on Wed, 25 Mar 2026 12:23:21 +0000)
> From: Klaus Gerlicher <klaus.gerlicher@intel.com>
> Date: Wed, 25 Mar 2026 12:23:21 +0000
>
> gdb/NEWS | 7 +
> gdb/doc/gdb.texinfo | 19 ++
> gdb/gdbthread.h | 4 +
> gdb/inferior.c | 58 +++++-
> gdb/inferior.h | 14 ++
> gdb/infrun.c | 6 +-
> gdb/testsuite/gdb.base/inferior-switch.c | 42 +++++
> gdb/testsuite/gdb.base/inferior-switch.exp | 172 ++++++++++++++++++
> .../gdb.mi/user-selected-context-sync.exp | 14 ++
> gdb/thread.c | 8 +
> 10 files changed, 341 insertions(+), 3 deletions(-)
> create mode 100644 gdb/testsuite/gdb.base/inferior-switch.c
> create mode 100644 gdb/testsuite/gdb.base/inferior-switch.exp
Thanks.
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,13 @@
>
> *** Changes since GDB 17
>
> +* By default, GDB now remembers which thread was selected when you were
> + last working in each inferior. When you switch back to that inferior,
> + GDB automatically restores the previous thread selection (if the thread
> + still exists). You can disable this behavior with
> + 'set remember-threads-per-inferior off' to use the original behavior
> + of always selecting the first available thread.
> +
> * Support for .gdb_index sections with version less than 7 has been
> removed.
This part is okay.
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index ceb69669ea6..dcbbcb273c1 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
This part is also okay, with one minor comment:
> +When enabled (the default), switching to a previously used inferior will
> +restore the thread that was active when you switched away. When disabled,
^^^^^^
I think we should say "selected" there, not "active". The latter is
ambiguous in this context.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
next prev parent reply other threads:[~2026-03-25 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 12:23 [PATCH v2] " Klaus Gerlicher
2026-03-25 12:23 ` [PATCH v2 1/1] " Klaus Gerlicher
2026-03-25 14:34 ` Eli Zaretskii [this message]
2026-04-28 9:26 ` [PATCH v2] " Gerlicher, Klaus
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=867br0x9k7.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=klaus.gerlicher@intel.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