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.133.124]) by sourceware.org (Postfix) with ESMTPS id 897B73858417 for ; Tue, 10 Jan 2023 15:39:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 897B73858417 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673365192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qTo3QP3z4i/IyG7OoTF1giqcuhLiNCUL/VaG/A6SqXA=; b=XXBixTjaKm6oXIvVt8/B+N/AZGHl8h1GR1dsegybj5bt+zNgikLm7Lf/Dx6Bw6/eE8eF5U T2HM/Jtn/6f8GxGIphk5DAqqCmZq7JNRN8ea0asHe/nu2xLfyky5bKEs72sTRHdGk+DGXl u0QrH9Vfy6rL/bFrXvIffOFUByLe1hU= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-230-q-hOZ1j-OjimsXa0HHIWPg-1; Tue, 10 Jan 2023 10:39:50 -0500 X-MC-Unique: q-hOZ1j-OjimsXa0HHIWPg-1 Received: by mail-ed1-f72.google.com with SMTP id z3-20020a05640235c300b0048ed61c1394so7890015edc.18 for ; Tue, 10 Jan 2023 07:39:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qTo3QP3z4i/IyG7OoTF1giqcuhLiNCUL/VaG/A6SqXA=; b=1RUt6C3ryDR42dHAj++TEKCHtIaWqxwOIPtp6djQVwfMnAzlMBSWTbbH6vfuzq3omc RtQ7eDj+nhdTDPlCv0HHWqvUn73i1UsJ34VM1dm84avDgeo+aBbzwyalEPtJ7GMAMV3U avwgZ0weaIijJG1L26Lh7tC+MZgdW/o8PBHmLcTmtTB2BJZVk41Y8LYFnyFTM7QeKWqe cPK6mqjXf1LMc0oYgWonId9Y/792bsZYUT9Age7YbwkLvQRjPvaMdIucdZnQtacrcUJe +Gx6vDYZlJgoKE9QWDHcy80zHwGS15ycBK7j0c0oGfB/mYjUYJJAYuiAWB/JqP3DdvuB OirQ== X-Gm-Message-State: AFqh2kppkYcFWk7nYsjweLcs2Nw+KNy7iY5DaNqNujF5r3Gokc5x2bsK fPEaqCmp07vzJf1Tte64JjiWR2dNuvnTcwOEgOvj79idcLiNdObW407bsRjY09n2n0cQ5lStqTC FxtPYkKBFz5zz78xxODPdfQ== X-Received: by 2002:a17:907:c78e:b0:7c5:f0a3:5d71 with SMTP id tz14-20020a170907c78e00b007c5f0a35d71mr59992019ejc.0.1673365189213; Tue, 10 Jan 2023 07:39:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtvAEUjHxM4kDWminQcFmsvynHQqb82E8uLaeDFJlf6qqbQrhzkyxURA6jIez9wCJ7WfBfK6A== X-Received: by 2002:a17:907:c78e:b0:7c5:f0a3:5d71 with SMTP id tz14-20020a170907c78e00b007c5f0a35d71mr59992007ejc.0.1673365188971; Tue, 10 Jan 2023 07:39:48 -0800 (PST) Received: from [10.43.2.105] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z20-20020a1709067e5400b00809e33ba33dsm5081902ejr.19.2023.01.10.07.39.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 07:39:48 -0800 (PST) Message-ID: <83ef1689-6035-75c6-8d7c-4e2633c9d751@redhat.com> Date: Tue, 10 Jan 2023 16:39:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] gdb/mi: add no-history stop reason To: Pedro Alves , gdb-patches@sourceware.org References: <20230102155645.66733-1-blarsen@redhat.com> <86c7cb0f-9571-0183-8e26-68533e00ece5@palves.net> From: Bruno Larsen In-Reply-To: <86c7cb0f-9571-0183-8e26-68533e00ece5@palves.net> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A,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: The v2 of this patch has a test case (and was approved by tromey and already pushed) -- Cheers, Bruno On 10/01/2023 16:36, Pedro Alves wrote: > Can we have a testcase for this? > > Pedro Alves > > On 2023-01-02 3:56 p.m., Bruno Larsen via Gdb-patches wrote: >> 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 >>