From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kdCVERGE6GP+tDAAWB0awg (envelope-from ) for ; Sun, 12 Feb 2023 01:15:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 3472A1E221; Sun, 12 Feb 2023 01:15:45 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=v8pEap96; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C46891E0D3 for ; Sun, 12 Feb 2023 01:15:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 145A8385783F for ; Sun, 12 Feb 2023 06:15:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 145A8385783F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676182544; bh=7IWJG8MdNo+QgzKYPkNN+w0r/5OdtKL3tSJIyvXf7jE=; h=Date:To:Cc:In-Reply-To:Subject:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=v8pEap96E5kymQqV9jZokyOnsuDTT3IriUNMvmz7f05lUGkACp6CBjUCIu3wlCK9s /0OEKavfp8lo34y5ayIS6+hkwjAaz2bJ4Ko34UqDhk1r2ocuZjc1d4OmXJPO0Mt50y Uu8zODRBSLpbCnXPPFligZ2+dIICVCa8j5DbOY+A= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A97793858D32 for ; Sun, 12 Feb 2023 06:15:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A97793858D32 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5dt-0005m5-OZ; Sun, 12 Feb 2023 01:15:17 -0500 Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5dt-0004lR-5O; Sun, 12 Feb 2023 01:15:17 -0500 Date: Sun, 12 Feb 2023 08:14:50 +0200 Message-Id: <83edqvif51.fsf@gnu.org> To: Gary Johnson Cc: gdb@sourceware.org In-Reply-To: <20230211225233.GB17240@phoenix> (message from Gary Johnson on Sat, 11 Feb 2023 14:52:33 -0800) Subject: Re: [PATCH] Fix 5-line offset of edit command References: <20230211100814.GA17240@phoenix> <83a61kjwp0.fsf@gnu.org> <20230211225233.GB17240@phoenix> X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb Reply-To: Eli Zaretskii Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" > Date: Sat, 11 Feb 2023 14:52:33 -0800 > From: Gary Johnson > > > > The problem appears to be in the edit_command() function in > > > cli-cmds.c, at line 966 in version 12.1. The solution is to > > > delete that line. The patch is below. > > > > This is probably editor-specific? > > No, it's not editor-specific. The command to run the editor is > created at the end of the edit_command() function: I meant the effect is editor-specific. IOW, what exactly does each editor display when passed a line number. > As I recall, this used to work long ago, then something changed and > the editor was always opened at line 6, then around 2020 it changed > again to open at the current line plus 5. I suspect > a copy-and-paste error, but I haven't looked into the history of > that function. I tried to look into the history with "git log -L", but got stuck at the commit that moved the function from another file. Maybe some Git expert could suggest how to cross that line? > I intended to send this to gdb-patches, but it looks like I wasn't > paying attention to the address and sent it to the general gdb list > instead. Yes, it is best to resent to gdb-patches.