From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by sourceware.org (Postfix) with ESMTPS id 601BB3858D28 for ; Tue, 24 Jan 2023 18:48:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 601BB3858D28 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-wm1-f44.google.com with SMTP id fl11-20020a05600c0b8b00b003daf72fc844so13519180wmb.0 for ; Tue, 24 Jan 2023 10:48:26 -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=wnY5a7EgxI2WBAjSoZW9REU77S0QxdPd97QiLtCTZRs=; b=Tt4zJ+/a5F/vKXWFlTIzXqc1hpwY00pIscFLVlRON4Akk/Acy57WCDtuChFvQiiJLB CcxvxCv8SY62OAGIZHwVxNQmJXqRbSNA7O6K8Ars7J/3V4ID6FOxXdivDfK5yz9ImH2A Gyyjwx4+MiRMi2koWD+/rmmjJUQbFJe+Gg/9tqry6HDI2vFbQq7s2BXyKKR5jUPrCZgY FRz+WSx+dQr2TsZgQfpgbv8dHvuEhcOQx/OpD0NepxbyY41YDTbWI1wYxnq8ccc2joub YfZM37eDplJuDA+9mMv8zJdzAcD2kEWPp+Uw8E+yWue9ZafWGgeQ4WOnvb147JInC6FE RUug== X-Gm-Message-State: AFqh2kpyBgYRNy0mMSv+Cn8r/qnz8MxCN8jC3wjhqznpEKOavlHIYNoh uzlLXGw3JbOQnNZiEebJFkCqnJ44ckmvzg== X-Google-Smtp-Source: AMrXdXv2UaZ1ZnDU5DJReXkTA4R1siv8toPb5zWIJZRsJALcOo4wIEYUL7IP6jsA0LA+7jd0aA/GqQ== X-Received: by 2002:a05:600c:1508:b0:3d3:5166:2da4 with SMTP id b8-20020a05600c150800b003d351662da4mr28736089wmg.8.1674586105018; Tue, 24 Jan 2023 10:48:25 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id 21-20020a05600c26d500b003d9b87296a9sm13347240wmv.25.2023.01.24.10.48.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Jan 2023 10:48:24 -0800 (PST) Subject: Re: [PATCH 1/2 version 3] fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp To: Tom de Vries , Carl Love , Bruno Larsen , Ulrich Weigand , "will_schmidt@vnet.ibm.com" , gdb-patches@sourceware.org References: <50474aa92ba82eff05cdc8f49001eae56be29670.camel@us.ibm.com> <89331c26795e3f7743e1e068dce43b3c2dd53008.camel@us.ibm.com> <071f24ecf9b3a2bbbe8fee7db77492eb55c5f3ff.camel@us.ibm.com> <1d9b21914354bef6a290ac30673741e722e11757.camel@de.ibm.com> <3e3c9c40f07ab01c79fe10915e76ffa187c42ad9.camel@us.ibm.com> <122f5d2d3db9ef1979b0f8da927d005f32bba82c.camel@us.ibm.com> <011768e8-2b76-f8ed-1174-fbaa020b15e7@redhat.com> <58cebd1a-7883-fbc6-ac94-c67293f8fc8d@redhat.com> <5e5dc4a49aa8feb370419a1efecf277673b7dfc7.camel@us.ibm.com> From: Pedro Alves Message-ID: Date: Tue, 24 Jan 2023 18:48:23 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_MANYTO,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: On 2023-01-24 3:53 p.m., Tom de Vries wrote: > On 1/23/23 20:17, Pedro Alves wrote: >> I'd think this was on purpose.  Note that next/step/reverse-{next/step} are line-oriented >> stepping commands, they step/next until the previous/next line.  While "finish" is described >> as undoing the_function call_. >> >> The manual says: >> >>   reverse-finish >>   Just as the finish command takes you to the point where the current function returns, >>   reverse-finish takes you to the point where it was called. Instead of ending up at the end of >>   the current function invocation, you end up at the beginning. > > As well as: > ... > finish > Continue running until just after function in the selected stack frame returns. Print the returned value (if any). This command can be abbreviated as fin. > ... > > It's only now that you mention the non-line nature of finish/reverse-finish that I realize that that is the case.  So I suppose the docs could be a bit more explicit about this aspect. I guess. > > I suppose an intuitive way to make available the two approaches (so without the user losing options) would be to introduce finishi next to finish and reverse-finishi next to finish, with the new commands retaining the current functionality and the old ones being adjusted to respect line boundaries.  But having the commands change behaviour is likely to cause confusion (well, assuming users notice the difference in the first place), so I'm not sure if that's a good idea. They sure would notice a difference. Say for example, a source line like: func1 (func2 (func3 ()))); and if you break in func3, and then do "finish", you expect that "step" steps into func2, while "next" would move to the next line. If you changed finish to be line-oriented, then a "finish" while inside "func3" would either step over the whole "func1" call line instead, or step into func2, depending on how you implement it. Regardless, it'd be a noticeable change, and I think a bad one. Also, it complicates where we print the return value, as we would no longer present the stop at the instruction where we are able to retrieve it.