From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QSp5EDWsLGcprCgAWB0awg (envelope-from ) for ; Thu, 07 Nov 2024 07:01:57 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=viric.name header.i=@viric.name header.a=rsa-sha256 header.s=dkim1 header.b=PNE7Ktt+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 257681E603; Thu, 7 Nov 2024 07:01:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 184F81E601 for ; Thu, 7 Nov 2024 07:01:54 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A327E3858D20 for ; Thu, 7 Nov 2024 12:01:53 +0000 (GMT) Received: from mail.viric.name (mail.viric.name [37.18.133.75]) by sourceware.org (Postfix) with ESMTPS id 14AD3385840D for ; Thu, 7 Nov 2024 12:01:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14AD3385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=viric.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=viric.name ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14AD3385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=37.18.133.75 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730980890; cv=none; b=iGhy+vObkOnSkErMHHSXUlFxRPQszgif3fbzsZXJFGjriwVTlvuW00Uq2Ht79eF0x3LccKXUwrN8VZHVIBwNqyqqs/QK8UvPk7tJNOPXOsvkvuvOZ5AYK6dfEam4e0N4ZfCxTlqJD0JQ6wgEiWAWvAvHMCJhtk+mINX29eBNRnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730980890; c=relaxed/simple; bh=GdNwu7cDZvLFi0mHrONsKjIQ0mIibYby2JUaboAzsoM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=PVU5r7ydUAOTAuRyrVTmCgOZjnefRvs3bg5YR/wxFhGitS2bkytmTX6BlEVR1uD4PIP6cy9BC+iiS3x77adFMRShnF5jmXc4xCqeTyi0nXv1eQ4EZdcno848Wqy5fOXIgCgPfqoJpiRoFg0hHTZHsn30/4OBj4DUlvyFZQ77cJk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail.viric.name (Postfix, from userid 1000) id 8C76513CEA5B; Thu, 07 Nov 2024 13:01:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=viric.name; s=dkim1; t=1730980886; bh=GdNwu7cDZvLFi0mHrONsKjIQ0mIibYby2JUaboAzsoM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PNE7Ktt+ET2ZQ370+aShpoigv+7BkPaPALp8RuKGhm2ddKSEOWnujZwU54bCrDIDg 4JkD1u5adE9ath2vGrhGwSJEFTJW6BhfAjZPOfxUto3WFZevi/fx4SIpQgEcR8blG/ c//UcpAU4w+6RrmsmO2zCAeFSSHuOJ5i38wouSTU= Date: Thu, 7 Nov 2024 13:01:26 +0100 From: =?utf-8?B?TGx1w61z?= Batlle i Rossell To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: Re: [PATCH] Fix 'edit' command to go to right line Message-ID: X-Accept-Language: ca, es, eo, ru, en, jbo, tokipona References: <87pln7qotz.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pln7qotz.fsf@redhat.com> 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 On Thu, Nov 07, 2024 at 11:13:12AM +0000, Andrew Burgess wrote: > Lluís Batlle i Rossell writes: > > > I attach this patch I used more than 20 years ago. > > > > I thought I had sent it in these years but apparently not. > > From fc0f3f1200f18c86a6d90185f02b1f5ce0c0235b Mon Sep 17 00:00:00 2001 > > From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= > > Date: Tue, 5 Nov 2024 23:18:30 +0100 > > Subject: [PATCH] Fix 'edit' command to go to right line > > > > The cursor was placed at a line off by a bunch of lines. > > Thanks for reporting this issue. I took a look at this patch and > started writing some tests for the 'edit' command. It would seem that > this was mostly untested until now! > > Anyway, though your patch does fix some cases, I found a bunch more > problems, so I'd like to propose the patch below as an alternative. > > I hope this should fix the case that I think you care about, though I'm > guessing really as you didn't describe exactly which case you believe > this fixes. If you are willing to give this alternative patch a try, > and report if this fixes your use case or not that would be really > helpful. > > Thanks, > Andrew (Now replying Cc to the list) Sure! Use your patch. I have EDITOR=vim. And when I'm debugging in some frame, I run 'edit' to get me to that position in vim. I don't really understand what is the get_first_line_listed () situation... I think it means that if 'list' has been run, then the editor on 'edit' will point to the line in the middle of the last 'list'. I like this as well, if I interpret correctly. Thanks, Lluís.