From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by sourceware.org (Postfix) with ESMTPS id C78D738555B6 for ; Tue, 10 Jan 2023 15:36:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C78D738555B6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f54.google.com with SMTP id bs20so12196579wrb.3 for ; Tue, 10 Jan 2023 07:36:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U2mWhPkLcD72/Hp44hQQia79pjJQL2LTPoeN4jbf3ZY=; b=ijsRztPPE+wgmQ/HOFszA0p0Xo2jkYDKMO2J64+sqhya4CeSNTuUT8KNlA0SscWawC 87fGRoQnIM73ct+B0W2ipacDxqfHU7FQwf+4UPELbmeVNx9Lap/9YLHRkQNUOZXL94i3 s+qMecycljbvB2ydwg9l3xU6eld3BW19GFxDc++45AADc7pUi3ju6gXh4YCQyZuLTHrq Ua40CTftUOPaRaySViqI4pR4oBGlOqFpBUoIz+bAUbe1seBFdsjtWVs4faKWxZOggoUP yCHhxa7BaURS1G5z8mofIB45/T+Aba+jynCwsMNV4L7/1agWe3ZgliyzvwycdxeKzjtt QTMw== X-Gm-Message-State: AFqh2kq2QSGc6Jx/F2TOw4r0fSPnDbmBOsvzAgwCST4a/r3eYFnA2PHU UwwVwIvV5E+1qJQlhAugy1ZFkr8wlZ30uakZ X-Google-Smtp-Source: AMrXdXuRcUr/v4Akj3FUvJ4yXC/2qjiDZjtRNMMgesNEwk70Mj9vDkSEXp1omIbWN7nRZGg7NSfbmg== X-Received: by 2002:a05:6000:1e19:b0:29e:81a5:7eca with SMTP id bj25-20020a0560001e1900b0029e81a57ecamr20440333wrb.8.1673364980283; Tue, 10 Jan 2023 07:36:20 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id c18-20020adffb52000000b0025e86026866sm13457783wrs.0.2023.01.10.07.36.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 07:36:19 -0800 (PST) Subject: Re: [PATCH] gdb/mi: add no-history stop reason To: Bruno Larsen , gdb-patches@sourceware.org References: <20230102155645.66733-1-blarsen@redhat.com> From: Pedro Alves Message-ID: <86c7cb0f-9571-0183-8e26-68533e00ece5@palves.net> Date: Tue, 10 Jan 2023 15:36:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20230102155645.66733-1-blarsen@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: 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 >