From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +znHEn6z42oHLA8AWB0awg (envelope-from ) for ; Thu, 29 Oct 2026 16:58:38 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z85Qc2tB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 317441E06B; Thu, 29 Oct 2026 16:58:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6008D1E007 for ; Thu, 29 Oct 2026 16:58:37 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C36514BA79AC for ; Thu, 29 Oct 2026 20:58:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C36514BA79AC Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z85Qc2tB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id AFBA54BA9018 for ; Thu, 29 Oct 2026 20:58:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFBA54BA9018 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AFBA54BA9018 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793307490; cv=none; b=RHt9RVdH/KJokNtTqLXsEuY+QramDGQ46lU+kl8yba3+g57v3h8+iAfdN1rMCSaSmf9xrGooyhUncGyhDD6WotF0vya/yO5yDZbFb8oPzhnOmzm5rhIR/IH+FxJocZjUEP5D1mJ41G5iFZMg1OByYTvEmlMcO9byOd63vSk+Bo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793307490; c=relaxed/simple; bh=JO+Bu66lNDiKCbHmCJ+p6fcRj0iz4kb06Y3FFhLcQXo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IBrLb13LNHg+HekO3fpkg2ItscGoRiZTjuB34AGK2JKJ7P3cp1BxXqIVF1sWsOFheZ/3BtjU6/nhtt48LPbE9fbktkJ+PswFVfP//Cf3u/r56nzddaaFp299q8KbNzfw7vJCCPkq2lCQp/NXzGss1BvKB22fELMFJOjrTfIiPUU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z85Qc2tB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFBA54BA9018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793307490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCBJtSh4FJ8Ecz/o9Pco7iwLr4GG0tzpwmhOfGw1m58=; b=Z85Qc2tB8l7nYY2dUHfaCAmUaYE4gTE+hA5iaDzQ4oscILbQ4cnbecFClg1ZeJAWkAjr/f g67UEp/PFYmHjjxBvSWa1Eb1V9LtBVR39HYK9RREL884/I/rpb4XdkyEMInzyUxh0x8JMm bMAutMNtiR9DuUeCaw9cWtyRV/78dOE= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-364-9YvMOlRvNpGmYGRuiZjR4A-1; Thu, 29 Oct 2026 16:58:08 -0400 X-MC-Unique: 9YvMOlRvNpGmYGRuiZjR4A-1 X-Mimecast-MFC-AGG-ID: 9YvMOlRvNpGmYGRuiZjR4A_1793307488 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E53751800601 for ; Thu, 29 Oct 2026 20:58:07 +0000 (UTC) Received: from glarsen-thinkpadp16vgen1.rmtbr.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B37DA767; Thu, 29 Oct 2026 20:58:06 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH 0/7] Start supporting multi-threaded inferiors with record-full Date: Thu, 29 Oct 2026 17:57:36 -0300 Message-ID: <20261029205743.1917668-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8QLPBmwWDBj2vqZEJSqtTYvwtnZhPxM1QL6Xb2XhDAs_1793307488 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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