From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jIocAlHilmqxDBsAWB0awg (envelope-from ) for ; Tue, 01 Sep 2026 10:33:53 -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=cigt58r3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B00A21E166; Tue, 01 Sep 2026 10:33:52 -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 F1C171E033 for ; Tue, 01 Sep 2026 10:33:51 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 196664BA799C for ; Tue, 1 Sep 2026 14:33:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 196664BA799C 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=cigt58r3 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 A5D374BA2E22 for ; Tue, 1 Sep 2026 14:33:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5D374BA2E22 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 A5D374BA2E22 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=1788273207; cv=none; b=Q0pCR8caBM+BXxMOBp2J67gQZNIvK36LU6N+FpKE84w1cEUfxZ0Su6Z5PZBYNszW8ZqGyfFSDng4XaAHbWYRrcd/9e7r/k/zADyqpQRxJIc+TeQfDx2g2TLLexM5HL9KjZ3VYpyTiKXu310Z0/A77b68dsuYpJ+O/Z5FXgcwM/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788273207; c=relaxed/simple; bh=aYe+SHM02LfelJzVLXeZVc9LEYlq+jxL6Ma4AQwmsfM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=i3dqNPNEaHnIAjv7EVwiGmy9TUd/RVO5XmKGT0z1c5Y4HI8EW7gKA0w0xdyLC2L1k3QGwQy2rizH5rZXV+yt9DMLHHSzxT63XKYRSoOr64bnKPbWrSy0RGo9iaF5oh2ISF1ztaxSGQ+w16gZd0dTS6dtlPbZkcq1bW9lM1wybC0= 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=cigt58r3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5D374BA2E22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788273207; 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=9gvUE5b9yw3SzAFokxkRpiAp2vgYQp8uM8us6mhHW6c=; b=cigt58r32VVm1iWQPue4hW40E7nFGuQ/EWnCPmrHEHKV60h5imC+Q5j0+CONTy3e8UzVuZ alt+krXmAqWFi5EgHXnwXeofsz5gjwoqRVCdzWp5LmNC6BNTMp9jLAOa+TpkZv7vmSag4I 6i9BbI51GFaSthRl7wxg7JrqknpJiEU= 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-590-sA7nKkyFNH-txAeQWEB47w-1; Tue, 01 Sept 2026 10:33:24 -0400 X-MC-Unique: sA7nKkyFNH-txAeQWEB47w-1 X-Mimecast-MFC-AGG-ID: sA7nKkyFNH-txAeQWEB47w_1788273204 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 C43071802149 for ; Tue, 1 Sep 2026 14:33:23 +0000 (UTC) Received: from glarsen-thinkpadp16vgen1.rmtbr.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 40F0C3000DA3; Tue, 1 Sep 2026 14:33:21 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb/record: fix "maint print record-instruction" at the start of log Date: Tue, 1 Sep 2026 11:33:16 -0300 Message-ID: <20260901143316.42661-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vPXGTqAZ3PqBVHzmFeMMbF07fGPqB6CZsU-PPWat3Bw_1788273204 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 My recent commit: commit caa9d8df0fca004a48cd9fd5048abaaaf2dd3eb1 Author: Guinevere Larsen Date: Thu May 28 15:36:33 2026 -0300 gdb/record: Refactor record history Caused a regression where, if a user was at the start of the record history and used the command "maint print record-instruction", GDB would throw an internal error for trying to print an out-of-bounds record. This commit fixes this by making the check for out of bounds printing independent of an argument being supplied. --- gdb/record-full.c | 10 +++++----- gdb/testsuite/gdb.reverse/maint-print-instruction.exp | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/record-full.c b/gdb/record-full.c index aa451c05a5d..f6d603d2357 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -2796,11 +2796,11 @@ maintenance_print_record_instruction (const char *args, int from_tty) if (offset == record_full_log.size ()) offset--; if (args != nullptr) - { - offset += value_as_long (parse_and_eval (args)); - if (offset >= record_full_log.size () || offset < 0) - error (_("Not enough recorded history")); - } + offset += value_as_long (parse_and_eval (args)); + + if (offset >= record_full_log.size () || offset < 0) + error (_("Not enough recorded history")); + auto to_print = record_full_log.begin () + offset; gdbarch *arch = current_inferior ()->arch (); diff --git a/gdb/testsuite/gdb.reverse/maint-print-instruction.exp b/gdb/testsuite/gdb.reverse/maint-print-instruction.exp index edf6ec081cd..199adebf08b 100644 --- a/gdb/testsuite/gdb.reverse/maint-print-instruction.exp +++ b/gdb/testsuite/gdb.reverse/maint-print-instruction.exp @@ -73,3 +73,8 @@ test_print true "1" "print following after reversing" test_print false "-10" "trying to print too far back" test_print false "10" "trying to print too far forward" + +# Return to the beginning of history and print. +# This used to cause an internal error. +gdb_test "reverse-continue" ".*" "moving to start of history" +test_print false "" "Print at the start of history" base-commit: 6f24afa4391bd33f1263378280b99385d2c13055 -- 2.55.0