Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/7] Start supporting multi-threaded inferiors with record-full
@ 2026-10-29 20:57 Guinevere Larsen
  2026-10-29 20:57 ` [PATCH 1/7] gdb/record-full: Add thread pointer to recorded instructions Guinevere Larsen
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Guinevere Larsen @ 2026-10-29 20:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: Guinevere Larsen

Record full has never been capable of managing multi-threaded
inferiors, but it never really told the user about that, instead
silently making things fail or infinitely loop. This series finally
changes that, making us truly support multi-threading.

For now, we are only able to record when manually scheduling, because
of issues with how to have multiple instructions at once, how to
manage waits for locks, and especially how to manage deadlocks, if
they should be managed at all. Also, we're unable to record the
creation of a thread, because we need to have a status for "not
created yet", needs to be removed from the inferior list and so
on. The latter is not too hard of an edge case, but I had limited time
to work on this, I decided to keep it for a later series, since the
current one already is an improvement on the situation.

The fourth patch is the most surprising one in my opinion. This is
needed because of the fifth patch, when we start dealing with threads
that have been exited, having the ptid isn't enough to find the thread
pointer in the inferior. In theory it would be possible to remove that
patch, but there are many edge cases to finding the instruction, which
would cause crashes. But I also personally think that using the thread
pointer is cleaner than the PTID, so I didn't try too hard without the
regcache change.

I am about to leave for a vacation, so it will be a while before I am
able to respond to feedback, but I felt it was important to send the
patch now to have a chance of merging this year or early next year.

Guinevere Larsen (7):
  gdb/record-full: Add thread pointer to recorded instructions
  gdb/record: add thread ID to the precsave format
  gdb/record: Make GDB automatically switch threads when replaying
  gdb: make regcache save a thread pointer, not ptid
  gdb/record: Record through a thread exiting
  gdb/record: Loudly warn or fail on dubious situations
  gdb/record: document recording multi-threaded inferiors

 gdb/NEWS                                      |   5 +
 gdb/doc/gdb.texinfo                           |   9 +-
 gdb/gdbthread.h                               |   2 +
 gdb/infcmd.c                                  |   6 +
 gdb/infrun.c                                  |   3 +
 gdb/linux-record.c                            |  18 +-
 gdb/ravenscar-thread.c                        |  41 +-
 gdb/record-full.c                             | 409 ++++++++++++++++--
 gdb/record-full.h                             |  16 +
 gdb/record.c                                  |   6 +
 gdb/regcache.c                                | 105 +----
 gdb/regcache.h                                |  17 +-
 gdb/scoped-mock-context.h                     |  18 +
 .../gdb.reverse/basic-record-full.exp         |   5 +-
 .../gdb.reverse/finish-reverse-next.exp       |  10 +-
 .../gdb.reverse/i386-avx-reverse.exp          |  39 +-
 gdb/testsuite/gdb.reverse/insn-reverse.exp    |   3 +-
 .../gdb.reverse/pthreads-precsave.exp         | 107 +++++
 gdb/testsuite/gdb.reverse/pthreads-reverse.c  |  40 ++
 .../gdb.reverse/pthreads-reverse.exp          | 128 ++++++
 gdb/testsuite/gdb.reverse/waitpid-reverse.c   |   3 +-
 gdb/testsuite/gdb.reverse/waitpid-reverse.exp |  10 +-
 gdb/thread.c                                  |  19 +-
 23 files changed, 827 insertions(+), 192 deletions(-)
 create mode 100644 gdb/testsuite/gdb.reverse/pthreads-precsave.exp
 create mode 100644 gdb/testsuite/gdb.reverse/pthreads-reverse.c
 create mode 100644 gdb/testsuite/gdb.reverse/pthreads-reverse.exp


base-commit: f747b0cd54bf4d2d7e0fcbabcf5b8c3377847b4d
-- 
2.56.0


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

end of thread, other threads:[~2026-10-30 13:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 20:57 [PATCH 0/7] Start supporting multi-threaded inferiors with record-full Guinevere Larsen
2026-10-29 20:57 ` [PATCH 1/7] gdb/record-full: Add thread pointer to recorded instructions Guinevere Larsen
2026-10-29 20:57 ` [PATCH 2/7] gdb/record: add thread ID to the precsave format Guinevere Larsen
2026-10-29 20:57 ` [PATCH 3/7] gdb/record: Make GDB automatically switch threads when replaying Guinevere Larsen
2026-10-29 20:57 ` [PATCH 4/7] gdb: make regcache save a thread pointer, not ptid Guinevere Larsen
2026-10-29 20:57 ` [PATCH 5/7] gdb/record: Record through a thread exiting Guinevere Larsen
2026-10-29 20:57 ` [PATCH 6/7] gdb/record: Loudly warn or fail on dubious situations Guinevere Larsen
2026-10-29 20:57 ` [PATCH 7/7] gdb/record: document recording multi-threaded inferiors Guinevere Larsen
2026-10-30  6:43   ` Eli Zaretskii
2026-10-30 11:32     ` Guinevere Larsen
2026-10-30 12:44       ` Eli Zaretskii
2026-10-30 13:20         ` Guinevere Larsen
2026-10-30 13:38           ` Eli Zaretskii
2026-10-30 13:40             ` Guinevere Larsen

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