From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id svNNL2ULoGprAzcAWB0awg (envelope-from ) for ; Tue, 08 Sep 2026 09:19:33 -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=iuM3ckZm; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 92A2B1E09E; Tue, 08 Sep 2026 09:19:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 5F6AC1E091 for ; Tue, 08 Sep 2026 09:19:32 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27F534BAE7FB for ; Tue, 8 Sep 2026 13:19:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27F534BAE7FB 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=iuM3ckZm Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 57B3B4BA2E15 for ; Tue, 8 Sep 2026 13:19:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57B3B4BA2E15 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 57B3B4BA2E15 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788873547; cv=none; b=HrQxpfagZCpeImMK0zrRP6oCkj3x1wIiuV1iB9WsKdD3gCJDBuHbWnX97vkQcYEplM3ruUVwqF1BU77XqAGHrrjR5x2QQQj5Ng/l6BiVk/Lpj7JSAmgYmDCMgf128q2KRYaedz1amE301CuUi0vfHEOoOuHOXQ2zRFSVhSSIM3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788873547; c=relaxed/simple; bh=M3YAKXECaLSnYP5treqYdxpL5sN5wNL4w9VKtNH+iDc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XrQmFuh4D9Sh1i3Y03tQEXrvBe2p93f35yBPkOLSUZsS9RS2wJRmEfNtQAZ1CJC+SX5niPzzMh38bYTWOQnAeAPG/MUa2M3+OHnvQ4mNuxuuKiNybq8pWuvsMk4TJERmqBtNUm+AFtCkdS8icAuk1fiQJZqgUt8yJVyLQc0b6bM= 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=iuM3ckZm DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57B3B4BA2E15 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788873547; 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=0lPrUqtAjfLR/tzGs8KwwVsxZNP+rLlmbhWN8ojOb8U=; b=iuM3ckZmVYilE69qDq19+5fTkQKn1hRRYcii9cl8lnmX3dFPMP7vJPURnhUOnNYf1kdFPW sYUeXFGuJYdo9GKFqmtfJ+c1rHGEp79azp0IcsMoFOj8p4KMsJf73yjpd7I5OHRSdhJlwk 2ljPsYhYUsPWXm4gRGsRDgJqHo2yZbc= Received: from mx-prod-mc-08.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-49-AySHsUXBOlq6-t_vj_ZrDA-1; Tue, 08 Sep 2026 09:19:06 -0400 X-MC-Unique: AySHsUXBOlq6-t_vj_ZrDA-1 X-Mimecast-MFC-AGG-ID: AySHsUXBOlq6-t_vj_ZrDA_1788873545 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1297D184BAA5 for ; Tue, 8 Sep 2026 13:19:02 +0000 (UTC) Received: from glarsen-thinkpadp16vgen1.rmtbr.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A9AFC18005B6; Tue, 8 Sep 2026 13:18:59 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb/record: fix missing "no history" message in some situations Date: Tue, 8 Sep 2026 10:14:00 -0300 Message-ID: <20260908131400.28513-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3xABJhU28iGE1DZGxuU3BexVldcr7FK1uSBDSXIrthI_1788873545 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 I recently noticed that the end of recoded history message wasn't shown when replaying an inferior until end end for the first time, it was only shown when trying to reverse past the start of history. Executing forward past the end will not warn the user that recording is going to start again, it just does so. This was happening because the out-of-history was only set when it caused the execution loop to stop, so using "next" to reach the end of history, for example, wouldn't trigger it as I expected. This commit fixes that to make out-of-history check only happen after the loop is finished. --- gdb/record-full.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gdb/record-full.c b/gdb/record-full.c index 26bd85d34f6..c02bc39f12c 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1362,19 +1362,11 @@ record_full_wait_1 (struct target_ops *ops, /* Check for beginning and end of log. */ if (execution_direction == EXEC_REVERSE && record_full_next_insn < 0) - { - /* Hit beginning of record log in reverse. */ - status->set_no_history (); - record_full_next_insn = 0; break; - } - if (execution_direction != EXEC_REVERSE + + else if (execution_direction != EXEC_REVERSE && record_full_next_insn == record_full_log.size ()) - { - /* Hit end of record log going forward. */ - status->set_no_history (); break; - } record_full_log[record_full_next_insn].exec_insn (regcache); @@ -1424,11 +1416,13 @@ record_full_wait_1 (struct target_ops *ops, { gdb_assert (execution_direction == EXEC_REVERSE); record_full_next_insn = 0; + status->set_no_history (); } - else if (record_full_next_insn > record_full_log.size ()) + else if (record_full_next_insn >= record_full_log.size ()) { gdb_assert (execution_direction == EXEC_FORWARD); record_full_next_insn = record_full_log.size (); + status->set_no_history (); } /* Reset the current instruction to point to the one to be replayed moving forward. */ base-commit: 0ca0b8de31ec76ff71f4a051db3dc1fcc9325154 -- 2.55.0