From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AD29C3858D39 for ; Mon, 2 Jan 2023 15:57:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675039; 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=Kb1DLl31RKdkRv0k99hkF+5pUECFjM/ICZfwzLAAdJ0=; b=V+BZL07daaK7ofyH76afT7gKNlxCIiW9nwdjb8IgtbxJxpSY7JmmSlSIXH8Th62UAwxRAy gLsZEVPyhnv0g9GZn9rOAhyqQiSh1KO1kEr8rwr7JXt6fXK/tEFom4FBp1OPMw0xG/HVKU 1WcLkZmiu4S1wLltphL9M8ydBvfgQNA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-TnyTavpRN6ShGB5Y-8KcnQ-1; Mon, 02 Jan 2023 10:57:16 -0500 X-MC-Unique: TnyTavpRN6ShGB5Y-8KcnQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC0163811F22 for ; Mon, 2 Jan 2023 15:57:15 +0000 (UTC) Received: from fedora.redhat.com (ovpn-192-190.brq.redhat.com [10.40.192.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E8CFD1121314; Mon, 2 Jan 2023 15:57:14 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH] gdb/mi: add no-history stop reason Date: Mon, 2 Jan 2023 16:56:45 +0100 Message-Id: <20230102155645.66733-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: When executing in reverse and runs out of recorded history, GDB prints a warning to the user, but does not add a reason in the stopped record, for example: *stopped,frame={addr="0x000000000040113e",func="main",args=[],file="/home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.reverse/solib-reverse.c",fullname="/home/blarsen/Documents/binutils-gdb/gdb/testsuite/gdb.reverse/solib-reverse.c",line="27",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="1" This problem was reported as record/29260. This commit adds the reason no-history to the record, making it easier for interfaces using the mi interpreter to report the result. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29260 --- gdb/NEWS | 5 +++++ gdb/doc/gdb.texinfo | 2 ++ gdb/infrun.c | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/NEWS b/gdb/NEWS index e61f06081de..3673bed8f46 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -5,6 +5,11 @@ * MI version 1 has been removed. +* MI changes + +** mi now reports 'no_history' as a stop reason when hitting the end of the + reverse execution history. + *** Changes in GDB 13 * MI version 1 is deprecated, and will be removed in GDB 14. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index a72b2b9eb26..8982151a7e3 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -30851,6 +30851,8 @@ The inferior returned from a system call. This is reported when @item exec The inferior called @code{exec}. This is reported when @code{catch exec} (@pxref{Set Catchpoints}) has been used. +@item no-history +There isn't enough history recorded to continue reverse execution. @end table The @var{id} field identifies the global thread ID of the thread diff --git a/gdb/infrun.c b/gdb/infrun.c index d5f97e33625..601d1a54701 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8406,7 +8406,10 @@ print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal) void print_no_history_reason (struct ui_out *uiout) { - uiout->text ("\nNo more reverse-execution history.\n"); + if (uiout->is_mi_like_p ()) + uiout->field_string ("reason", "no-history"); + else + uiout->text ("\nNo more reverse-execution history.\n"); } /* Print current location without a level number, if we have changed -- 2.39.0