Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v4 0/1] gdb: remember previously selected thread per inferior
@ 2026-09-11  8:10 Klaus Gerlicher
  2026-09-11  8:10 ` [PATCH v4 1/1] " Klaus Gerlicher
  0 siblings, 1 reply; 2+ messages in thread
From: Klaus Gerlicher @ 2026-09-11  8:10 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess, pedro, kevinb, eliz

From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>

Hi,

This is V4 of the patch to remember the selected thread when switching
between inferiors.

Thanks, Kevin, for the review. Sorry about that - I shamefully sent out
an unfinished/unrebased branch with V3, my workflow is just not well adjusted
to upstreaming since I don't do this too regularly. It failed to build
and had failing tests and I didn't realize. Apologies for the noise, addressing
your findings here, anything else is in V3:

https://inbox.sourceware.org/gdb-patches/20260908133426.444197-1-klaus.gerlicher@intel.com/

Changes since V3:
* Fixed build failure: 'stored_tp->state' -> 'stored_tp->state ()',
  since thread_info::state is now a member function.
* Fixed test compile issue in inferior-switch.c.
* Fixed the test failures you reported: prepare_test in
  inferior-switch.exp now explicitly enables
  'set remember-threads-per-inferior on', since the feature defaults to
  off as of V3 and the tests never turned it on.
* Reworded the texinfo doc per Eli's earlier feedback: "the thread that
  was selected" instead of "the thread that was active".
* Fixed a gap found while re-testing: turning the feature on with
  'set remember-threads-per-inferior on' didn't record anything for the
  inferior currently on - only future explicit/implicit switches
  got captured.  Added a set_func on the setting that captures the
  current thread right away when enabled.
* Added a regression test for that gap; the old tests wouldn't have
  caught it.
* Fixed two stale comments left over from before the set_func was added
  (one claimed there were only two save mechanisms, the other described
  save_inferior_last_thread's callers too narrowly).
* Documented test_disabled_behavior in the file's header comment; it was
  missing from the list.

Verified this time:
* Rebuilt from a clean checkout against current master.
* gdb.base/inferior-switch.exp: 47/47 pass.
* gdb.mi/user-selected-context-sync.exp: 483/483 pass.

Tested on x86_64 and aarch64.

Thanks,
Klaus

Gerlicher, Klaus (1):
  gdb: remember previously selected thread per inferior

 gdb/NEWS                                      |   8 +
 gdb/doc/gdb.texinfo                           |  20 ++
 gdb/gdbthread.h                               |   4 +
 gdb/inferior.c                                |  76 ++++++-
 gdb/inferior.h                                |  14 ++
 gdb/infrun.c                                  |  12 +-
 gdb/testsuite/gdb.base/inferior-switch.c      |  42 ++++
 gdb/testsuite/gdb.base/inferior-switch.exp    | 187 ++++++++++++++++++
 .../gdb.mi/user-selected-context-sync.exp     |  14 ++
 gdb/thread.c                                  |   8 +
 10 files changed, 382 insertions(+), 3 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/inferior-switch.c
 create mode 100644 gdb/testsuite/gdb.base/inferior-switch.exp

-- 
2.34.1

________________________________________
Intel Deutschland GmbH 

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany 

Tel: +49 (89) 99143-0 

www.intel.de 

Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman

Chairperson of the Supervisory Board: Sonja Pierer

Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11  8:10 [PATCH v4 0/1] gdb: remember previously selected thread per inferior Klaus Gerlicher
2026-09-11  8:10 ` [PATCH v4 1/1] " Klaus Gerlicher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox