From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 19:52:47 2022 Received: (at submit) by debbugs.gnu.org; 27 Oct 2022 23:52:48 +0000 Received: from localhost ([127.0.0.1]:59715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooCg3-00017o-Kx for submit@debbugs.gnu.org; Thu, 27 Oct 2022 19:52:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:34574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooCg2-00017h-0G for submit@debbugs.gnu.org; Thu, 27 Oct 2022 19:52:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooCg1-0004E6-H5 for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 19:52:45 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooCfw-0001e8-61 for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 19:52:45 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 7F3F43200920 for ; Thu, 27 Oct 2022 19:52:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 27 Oct 2022 19:52:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t= 1666914756; x=1667001156; bh=t21WFuNlfX8PvkY9ujVe1oDPykHe4cZLFMi 3tHXFqao=; b=Qest+E+aNMpE1h6d04oJi7ttAJNv5lTy5Xz91lnXkq9zIUMNwSb T1k4GlWXVWz07g19MOf8HtBxTGrEITO3VYZv9WREi2+J0KhyrdWxnW5BUmp/rbqV ZSSI2HrPMylNhiKp/adFjlkGySOHm+KxY/w2wuoVWWX+RcbD64R9lNQGal3tknYB jwps37lOtlVlnPjwMkPx9T9jpFHthr7KNI1CKYotxPiuxxGQt7bzch+nRmTvIEaA 7ueijEl3IzPzeOb8jXQ8ZsVllP6vp1EklWgQTVGWha8ZQju3C49hJpoc3D4ELBBD 0QF/2XycktMzMMSSuXk+ur1d8h2FQN/x9Fw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666914756; x= 1667001156; bh=t21WFuNlfX8PvkY9ujVe1oDPykHe4cZLFMi3tHXFqao=; b=G ESz8Whtm9+b3sTVWSPFVNhFCyqJaaIgzl3XSPUtWg/5oSFgUb/qydxNtTCF5WYT1 3/byAdEabYQnwllJb/LsMZMNYJXrFKiuNZjiycWTpozAx2ddEft8QbkebMNx5huc JWzc9mJ03msOAVRXcICyEDQMihWK1pwOK5bk4LmjMGHQ3w55F07gUMqrfQbXKipp tfUr1uk48+iRUfcBS8wtRPRz7r63W3knXqTTJ8iKYjzLSohWlqwbzRvZU4EFCxSJ 2x8y+975h5dAz1Ry85owXbUIGoCoW1uTyrXDiqGPuUDaD3NBfbem3jYMXzUB3Pwg 9mikvPFRZmopvEL8MKsXg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdehgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddquddtmdenucfjughrpefhvf fufffkgggtsehttdertddttddtnecuhfhrohhmpeffihhmrgcumfhoghgrnhcuoeguihhm rgesshgvtghrvghtshgruhgtvgdrnhgvtheqnecuggftrfgrthhtvghrnhepkedvudetge ehvdeguedutdfgteffudeikeeiieetgeffheeugeehtefgieehffefnecuffhomhgrihhn pehsfhhmvhhiiidrphihnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepughimhgrsehsvggtrhgvthhsrghutggvrdhnvght X-ME-Proxy: Feedback-ID: i3e8042a0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 27 Oct 2022 19:52:35 -0400 (EDT) From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 29.0.50; gud-gdb can't find core file if executable is in a different directory Date: Thu, 27 Oct 2022 16:52:32 -0700 Message-ID: <87wn8komdb.fsf@jpl.nasa.gov> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.20; envelope-from=dima@secretsauce.net; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi. I'm using a bleeding-edge build of emacs, although I think this is a very old bug. I just ran a Python program in $DIRECTORY: python3 program.py python3 is in /usr/bin. There was a bug, the program crashed, dumped core, and I want to debug it. I do this from the buffer containing program.py (default-directory is $DIRECTORY, which contains program.py and is NOT /usr/bin) M-x gud-gdb gdb --fullname /usr/bin/python3 core.sfmviz.py.1807941 It says this: /usr/bin/core.sfmviz.py.1807941: No such file or directory. It works fine from the shell, outside of emacs. The issue is that gud-gdb is changing default-directory to /usr/bin (where the binary executable lives). But I never asked for that, and this is unexpected: I'd expect it to do the same thing as that gdb command would do in the shell. Thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 28 02:23:53 2022 Received: (at 58826) by debbugs.gnu.org; 28 Oct 2022 06:23:53 +0000 Received: from localhost ([127.0.0.1]:60023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooImX-0002JX-GA for submit@debbugs.gnu.org; Fri, 28 Oct 2022 02:23:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooImU-0002JJ-QW for 58826@debbugs.gnu.org; Fri, 28 Oct 2022 02:23:52 -0400 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 1ooImP-0000yc-Fb; Fri, 28 Oct 2022 02:23:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=bZ/15Cwv84UaRaNW+ALRAw5Uw83Zl34rv/MDrARm9CI=; b=JJX5fljlmHjK NtOjsQoRqncm9SLvgdboqyaA+D1iKmY9zk8MbkcGzyfSd/kqXFVOCz5whKK3LKgYKv4BpX/1iGCy+ C5eNKgiG79fPAxFMANE9KNI3q20s0dm5k8I61nHwO631FI3wJ2MAP3+9r6p0iFudBlNJ2WQrkOKQv bHTjapSX8rkE9ZShxNZL972lEjV1rOJwMfA11QIkZPVz7vaXlu2Igugj4NFJGDrqUtFSEE5qrjaGX OQN5OuikDWkWzKaUQ2wnJWQT1Nhm2IWZ/ARnPy0cVnneowpMi4n4Bgwkhn5LQbi/CudSYHXa2B4e+ B4ZS4QpJ4fGFXR6kAo9mVQ==; 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 1ooImO-0001u4-Tg; Fri, 28 Oct 2022 02:23:45 -0400 Date: Fri, 28 Oct 2022 09:23:40 +0300 Message-Id: <83zgdgjwk3.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-Reply-To: <87wn8komdb.fsf@jpl.nasa.gov> (message from Dima Kogan on Thu, 27 Oct 2022 16:52:32 -0700) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Dima Kogan > Date: Thu, 27 Oct 2022 16:52:32 -0700 > > Hi. I'm using a bleeding-edge build of emacs, although I think this is a > very old bug. > > I just ran a Python program in $DIRECTORY: > > python3 program.py > > python3 is in /usr/bin. There was a bug, the program crashed, dumped > core, and I want to debug it. I do this from the buffer containing > program.py (default-directory is $DIRECTORY, which contains program.py > and is NOT /usr/bin) > > M-x gud-gdb > gdb --fullname /usr/bin/python3 core.sfmviz.py.1807941 > > It says this: > > /usr/bin/core.sfmviz.py.1807941: No such file or directory. > > It works fine from the shell, outside of emacs. The issue is that > gud-gdb is changing default-directory to /usr/bin (where the binary > executable lives). But I never asked for that, and this is unexpected: > I'd expect it to do the same thing as that gdb command would do in the > shell. This is the documented behavior of "M-x gud-gdb": (defun gud-gdb (command-line) "Run gdb passing it COMMAND-LINE as arguments. If COMMAND-LINE names a program FILE to debug, gdb will run in a buffer named *gud-FILE*, and the directory containing FILE becomes the initial working directory and source-file directory for your debugger. AFAIU, if you run the debugger like this: gdb --fullname python3 core.sfmviz.py.1807941 then GUD will not change the default-directory to /usr/bin, which I believe is what you want. GDB will then locate the Python executable either in the current default-directory or by searching PATH. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 28 02:36:26 2022 Received: (at 58826) by debbugs.gnu.org; 28 Oct 2022 06:36:26 +0000 Received: from localhost ([127.0.0.1]:60054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooIyg-0002cl-1L for submit@debbugs.gnu.org; Fri, 28 Oct 2022 02:36:26 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:52845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooIye-0002cX-54 for 58826@debbugs.gnu.org; Fri, 28 Oct 2022 02:36:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 145F15C006F; Fri, 28 Oct 2022 02:36:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 28 Oct 2022 02:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1666938979; x=1667025379; bh=nn s9Rnb05m8qLN6asO153D7qro2VRuc0f/aQuTrRbHo=; b=WjdHPTS1em9v89TrAj stMh5KaCMzfKyH1ay8sj5K/lIHaFibO3Ap3m9EmHgHzuWZ+sHvYi2jP8Aa9aR+p1 oExsmfRbWAyrgqofCWHuYTn2nprv5wawyOAjOl1j7sw3+d9Nt+1zCuU/NgHv+OVe yQisStYqJnxKib2AspxLp/f0LTl4D3iaVD0x8QpfeDZ9a+KUM3DAOXQFV7DiPHaf ebnN9MFF8IgXDHvwux2U7gEBdrbVq/BrMNvCUlGy7IDyIwoeGWurs5Xr6FP0KJ2U JLZj/M6PAy4O2I1x+4uVQ7+aa2NX1ODsvUolKCF0k5QMyxj89cHjLxAE5lMaLL4U Yt1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1666938979; x=1667025379; bh=nns9Rnb05m8qLN6asO153D7qro2V Ruc0f/aQuTrRbHo=; b=PmBzspR8JBZv0Z86va5HylVzUfY7/fO2ZUT7UsQv9IG4 6e2vTODgQ8iNcz+CYkX6yJzCTlQXcTYyhyTopypyg8TT0FGUY9PsDY+rgtMqaHGN ylcnhToegFGRwM2YfdSLzRBFbN4CVhBepHQTXTIOtb3PrGYeqWGVQLcIYxpT5mm+ yJ3IV65qRB/X1FVgQCNnaErARclKhGPDANZhnYBBGOCrkByJtlBIYsEyrhmLBTf0 V91tWIUcnzzKrLKoezUd7zc2ZD6zL0nyByeDMbol97aUXbJyunzfl1JNm0xH2CAF 6EvHoY0I+Y/RHHRoDfc3hXdv0XC7rP6O+BQy5GMOhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdehgddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepffhimhgr ucfmohhgrghnuceoughimhgrsehsvggtrhgvthhsrghutggvrdhnvghtqeenucggtffrrg htthgvrhhnpeejveevgfegieegueevteffgefgteefgeeiveekfeektdekkedtieevhfeh leegteenucffohhmrghinhepshhfmhhvihiirdhphienucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeguihhmrgesshgvtghrvghtshgruhgtvgdr nhgvth X-ME-Proxy: Feedback-ID: i3e8042a0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Oct 2022 02:36:18 -0400 (EDT) References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> User-agent: mu4e 1.8.7; emacs 29.0.50 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory Date: Thu, 27 Oct 2022 23:29:37 -0700 In-reply-to: <83zgdgjwk3.fsf@gnu.org> Message-ID: <87y1t0mp40.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58826 Cc: 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks for replying, Eli. Eli Zaretskii writes: > This is the documented behavior of "M-x gud-gdb": > ..... > AFAIU, if you run the debugger like this: > > gdb --fullname python3 core.sfmviz.py.1807941 > > then GUD will not change the default-directory to /usr/bin, which I > believe is what you want. GDB will then locate the Python executable > either in the current default-directory or by searching PATH. OK. It's documented, but it's still not good. What if the executable wasn't in the $PATH? It's also really unintuitive to have an implicit change of directory here, and it would match most people's expectations if it was changed, I think. Do you know why we're doing that? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 28 03:20:45 2022 Received: (at 58826) by debbugs.gnu.org; 28 Oct 2022 07:20:45 +0000 Received: from localhost ([127.0.0.1]:60200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooJfZ-0003rC-A2 for submit@debbugs.gnu.org; Fri, 28 Oct 2022 03:20:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooJfU-0003qv-Ql for 58826@debbugs.gnu.org; Fri, 28 Oct 2022 03:20:44 -0400 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 1ooJfO-0002Kt-Q8; Fri, 28 Oct 2022 03:20:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wf51Pazeoq54yji7BMfz6431mRv6Q0HrOrLzwWVbCnA=; b=PC56nHuMLUJa 7Ll2/iPPmydx5RWBx2rRakmpdoeUNiJp+Ev+zGWF9P7ZJnm58zcA5TVTEQgYsGEYqS+aJ5QMV2s7u gYkzxVhqqyghgwmxHF0RgSPRysa9Vs4P1CJ3WsQAh4sJDC49KK10DOGZuI9KR5HegXBDEjg4dv0MV mzUEjVopQzYUAHuwFEX5DinXBYK5uxYZxnLHPi42aLKpqR5NpNy3+aZEHZE5TWFf8ZazXlk0FjrFz /YxXshcruThAmdIalX+f28C1S0QcHaT9uL4LLo8hhAZuyytDPNwcJwhO45QV0a7SFZKclHHkmKefh QYMB5bIEmmTcGP8xDZRODg==; 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 1ooJfK-00039a-CT; Fri, 28 Oct 2022 03:20:33 -0400 Date: Fri, 28 Oct 2022 10:20:26 +0300 Message-Id: <83pmecjtxh.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-Reply-To: <87y1t0mp40.fsf@secretsauce.net> (message from Dima Kogan on Thu, 27 Oct 2022 23:29:37 -0700) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Dima Kogan > Cc: 58826@debbugs.gnu.org > Date: Thu, 27 Oct 2022 23:29:37 -0700 > > > This is the documented behavior of "M-x gud-gdb": > > ..... > > AFAIU, if you run the debugger like this: > > > > gdb --fullname python3 core.sfmviz.py.1807941 > > > > then GUD will not change the default-directory to /usr/bin, which I > > believe is what you want. GDB will then locate the Python executable > > either in the current default-directory or by searching PATH. > > OK. It's documented, but it's still not good. What if the executable > wasn't in the $PATH? Is that what happens in your case? In general, you need in that case to change to the directory of the executable, and invoke gud-gdb from there. IME, the current behavior covers most of the use cases: either you are debugging a program you are developing from its source tree, or you are debugging an installed program that's on PATH. > It's also really unintuitive to have an implicit change of directory > here, and it would match most people's expectations if it was changed, I > think. Do you know why we're doing that? If you think about that, it's actually quite natural: it makes the files you are likely to access from the debug session appear in the current directory. In any case, this is a long-standing behavior. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 12 23:32:43 2022 Received: (at 58826) by debbugs.gnu.org; 13 Nov 2022 04:32:43 +0000 Received: from localhost ([127.0.0.1]:49787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou4fj-0002Yc-8G for submit@debbugs.gnu.org; Sat, 12 Nov 2022 23:32:43 -0500 Received: from mail-ot1-f43.google.com ([209.85.210.43]:46007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ou4fh-0002YM-8E for 58826@debbugs.gnu.org; Sat, 12 Nov 2022 23:32:42 -0500 Received: by mail-ot1-f43.google.com with SMTP id 94-20020a9d0067000000b0066c8d13a33dso4939454ota.12 for <58826@debbugs.gnu.org>; Sat, 12 Nov 2022 20:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=9cBvzUTwWzgKPTG1BcyQzB26ncMprqt/tsC+XzvEKs0=; b=kE3LnQSzUU39nHgCUPAPuL85NqUXgAq1dIogh8YHtGM6rXPoIlN7Pz2k4Y0h1BBMvW nnmQE9WbKTvsB4D5F/I8qSoVc55YCAISeL3F1Gk8fBlEmJhzmEpIA0j4XgmqpDekmNKr dGilSAN0NOzA27inrEcs+SnIT2CUjuaAke4KvPs5v/Sn+VHDdSr+a1LxrjnwEZiFwSXv o4K2u2IrOap5KGtuxf6aJ6lLqAZ5c3ANZFBfCd4AoNPEC8hT5YSdn4ijxstq/6WCe4rb ZX1SDUWDItg9rLx4XZmSmZEQ+qxV84axlQBNxODZMZsJjlkylacPmUkn+aTmEfNWnsVl VB3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9cBvzUTwWzgKPTG1BcyQzB26ncMprqt/tsC+XzvEKs0=; b=xenvVOepNwbtmbRLa6sOooxiOl8GFgpwKhhO29Mq9l23kvZm+//9QD4bwwedOQVedv o8X9loj2zO5sK0JodrQLXTozk/8tIRVJSyD1ioVsG4V0LFNCQD7Gqts78VO89VAg+D3n 3WW1zC7PE2aizHeptTsD6lMfISsc72EI8AD2k+SGVfxCzPnEYYNkp9lGcXxCR5Qzg498 vnXi9o4f7stlZ2NpOv4pHDOqbrSHwIPq1585AsvVBz3ULf4Dswas/0ZRhpmGKQxu3+Pu zujooxiQIQz2QhnXHOmg0bhcUXNO3FqX3VgKq0qLhCZcV9D1XpyvUZRI5ZOTfu/MXC6l 45uw== X-Gm-Message-State: ANoB5pmkGvCSp45BWR3WpOqCyUMHrtCO9gdYgWzbeZvapKkDWDzOUmqx moaG0vEkM+9eKMTZKwcBHOd35ONZRsVtPiuscWI= X-Google-Smtp-Source: AA0mqf6zf2n/QQtoIoi51npqJmORiCd6wkDppb/E0UpUwk75Py62IrUhUYVrhRNNpQXaQXEv//R1Ei0Bmn0/UdgAm+o= X-Received: by 2002:a9d:6399:0:b0:661:c48b:12db with SMTP id w25-20020a9d6399000000b00661c48b12dbmr4167619otk.105.1668313955525; Sat, 12 Nov 2022 20:32:35 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 12 Nov 2022 20:32:34 -0800 From: Stefan Kangas In-Reply-To: <83pmecjtxh.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Oct 2022 10:20:26 +0300") References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> X-Hashcash: 1:20:221113:eliz@gnu.org::7JorK58nuenv0ALf:3QUY MIME-Version: 1.0 Date: Sat, 12 Nov 2022 20:32:34 -0800 Message-ID: Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58826 Cc: Dima Kogan , 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> > AFAIU, if you run the debugger like this: >> > >> > gdb --fullname python3 core.sfmviz.py.1807941 >> > >> > then GUD will not change the default-directory to /usr/bin, which I >> > believe is what you want. GDB will then locate the Python executable >> > either in the current default-directory or by searching PATH. >> >> OK. It's documented, but it's still not good. What if the executable >> wasn't in the $PATH? > > Is that what happens in your case? > > In general, you need in that case to change to the directory of the > executable, and invoke gud-gdb from there. > > IME, the current behavior covers most of the use cases: either you are > debugging a program you are developing from its source tree, or you > are debugging an installed program that's on PATH. > >> It's also really unintuitive to have an implicit change of directory >> here, and it would match most people's expectations if it was changed, I >> think. Do you know why we're doing that? > > If you think about that, it's actually quite natural: it makes the > files you are likely to access from the debug session appear in the > current directory. I think Eli is right here. > In any case, this is a long-standing behavior. Indeed. So any change would also need to be careful not to break backwards-compatibility in relevant cases. At the same time, users might not expect the change of directory to depend on whether or not she says "python3" or "/usr/bin/python3". So to avoid just wontfixing this outright, here are some alternative ideas: - Perhaps we could skip changing the directory if the prefix (in the above case "/usr/bin") is already in PATH? - But that won't take care of the case where it is *not* in PATH. So perhaps we should have even more heuristics to also see if it is some interpreter (under the assumption that interpreters generally don't live together with the source code that is being debugged)? IOW, if --fullname is some well-known value like "python3", we don't change directory by default. We would need to consider if such a change would break anything for relevant use-cases, of course. That's the best I could think of, at least. If that is overcomplicating things, I guess we will have to close this bug as wontfix, as unsatisfying as that seems. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 23:17:33 2022 Received: (at 58826) by debbugs.gnu.org; 15 Nov 2022 04:17:33 +0000 Received: from localhost ([127.0.0.1]:52494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ounO9-00028V-IW for submit@debbugs.gnu.org; Mon, 14 Nov 2022 23:17:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ounO7-00028I-6t for 58826@debbugs.gnu.org; Mon, 14 Nov 2022 23:17:31 -0500 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 1ounO1-0004Gt-6B; Mon, 14 Nov 2022 23:17:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=dGL4yFtpu0cXuASuPKqUOuq/+0jb+2dQDhPl/A4UeeY=; b=FChleiQ136Av GgN+6ny6nwk51f0Cc1AFThnD7AsTZvY2l5WjFVuw6AneHjswMdA20s/eMxcnvPPCPGn48vgNU2HsV 8sHA5VKBtd7pfVXDnj6rhS5AFbwrZHXxxvkpZBR+C1mu794JfI/v88vIOeRl46jy+Oc8jkNMm7wvD s3Tw36+xuhAJTn9/TS9wqXYgTd9F7gBbNvB+MK0apQ8qaqbA7Ojm/Ak6TCClwBMckzZeSlkemzIYH Z91EqQwLndenrT8ESCFImzJlBN+8dBnMmT0/iXGlP3vaws53SYVoc3kOC9Wi/W8QKns1Tku6Dn4l2 8SJ/A60dQmbGcY0I3neP7Q==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1ounNs-0004vH-17; Mon, 14 Nov 2022 23:17:16 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Stefan Kangas In-Reply-To: (message from Stefan Kangas on Sat, 12 Nov 2022 20:32:34 -0800) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> Message-Id: Date: Mon, 14 Nov 2022 23:17:16 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: eliz@gnu.org, dima@secretsauce.net, 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I think I gave GDB commands to specify the file name of each file that GDB would look at. If there isn't a `set' command to specify where to find the core dump, how about suggesting that in a GDB bug report? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 08:47:02 2022 Received: (at 58826) by debbugs.gnu.org; 15 Nov 2022 13:47:03 +0000 Received: from localhost ([127.0.0.1]:53487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouwHG-0002u0-Gt for submit@debbugs.gnu.org; Tue, 15 Nov 2022 08:47:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouwH4-0002tN-Mr for 58826@debbugs.gnu.org; Tue, 15 Nov 2022 08:47:01 -0500 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 1ouwGy-0006hZ-Tr; Tue, 15 Nov 2022 08:46:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WDJ0/KzV3i4p1u8VrTOjLYkZ8bH6UEjQ9CvU+dkrbyE=; b=eF+1IbxTPtvt M1jrVror2GKBK0PmIz1B2vK4IwEAo3F13hlNLPI8vC9Q0C7KdhtWZknkfjXoHec4BKBC+hu8bWbwy v7kkC5q+rdhGYH3pyExURpXkudqQ5ezTOXzMN77shhTCC9nyZ4vV/7rKvPFJ4aUSYwQXS20mQrzq9 8wHN9agDdJ0Iaroeszn7pdUVFK7wfsn5PWcKCMn9/DZMFjLkt1iodb3ASQhC8oXM0QBzty67wNgkR o7aal4e7f0DLHU41J3u9LDOSxHBaj3MItnLEMTxr108mrr5TvJY2JibKfRb+bDjapRv6So9yhyibL 10BZKFTaVlPwZjanQZyAHA==; 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 1ouwGv-0002cy-QF; Tue, 15 Nov 2022 08:46:43 -0500 Date: Tue, 15 Nov 2022 15:46:56 +0200 Message-Id: <83h6z0ib3j.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Mon, 14 Nov 2022 23:17:16 -0500) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Richard Stallman > Cc: eliz@gnu.org, dima@secretsauce.net, 58826@debbugs.gnu.org > Date: Mon, 14 Nov 2022 23:17:16 -0500 > > I think I gave GDB commands to specify the file name > of each file that GDB would look at. If there isn't a `set' command > to specify where to find the core dump, how about suggesting that > in a GDB bug report? This is not about GDB commands, this is about the behavior of GUD when invoking GDB to debug a program. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 00:05:56 2022 Received: (at 58826) by debbugs.gnu.org; 18 Nov 2022 05:05:56 +0000 Received: from localhost ([127.0.0.1]:34945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovtZc-0008L7-1s for submit@debbugs.gnu.org; Fri, 18 Nov 2022 00:05:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovtZa-0008Kt-5B for 58826@debbugs.gnu.org; Fri, 18 Nov 2022 00:05:54 -0500 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 1ovtZU-0001Y8-R7; Fri, 18 Nov 2022 00:05:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=f6YUOEFEFAkGTriqn+Q9PWe4SrVe0EGkhdvbtwdd9mQ=; b=Pr7LSYejM1CQ wvKG6CehPIH/TWLCY2qNHpqqs1fak/oYBgpTe3ekZb+MMQ/xCE/2k9a0caTtUkHTLGMEyYgpRkCqe IBIIMitBOOY+m+uiAFIx7eV+d2+P3wM7HH/JyRgVCdfXVobUzKSeIjN/VIsrIBnkoD4oO/cBFmZaY PGoDufS0XL+UxKTP3oqQ1Q6BP7gyO0x8XbqwJ7Knn02Xb9gIKQsA0TSwYl7TX7M37c/hwT2mnGIJu kB+mNZ8EKjztDc6cww6X/CZ7EXyUuJ/BOmjcz7j/SWRBAZqeDA4U5gYIoMbHb3FRt6AkVB/YaRish aP22P4OVg5JYWiajOiN5RA==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1ovtZT-00054s-Vo; Fri, 18 Nov 2022 00:05:48 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83h6z0ib3j.fsf@gnu.org> (message from Eli Zaretskii on Tue, 15 Nov 2022 15:46:56 +0200) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> Message-Id: Date: Fri, 18 Nov 2022 00:05:47 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > This is not about GDB commands, this is about the behavior of GUD when > invoking GDB to debug a program. I see. There are supposed to be GDB options it can specify on startup to get the right behavior from GDB. Is there some such option that is missing from GDB? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 03:23:10 2022 Received: (at 58826) by debbugs.gnu.org; 18 Nov 2022 08:23:10 +0000 Received: from localhost ([127.0.0.1]:35187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovweT-0005Nt-Ux for submit@debbugs.gnu.org; Fri, 18 Nov 2022 03:23:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovweR-0005Nh-SM for 58826@debbugs.gnu.org; Fri, 18 Nov 2022 03:23:08 -0500 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 1ovweM-0005vK-FM; Fri, 18 Nov 2022 03:23:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3IZVgBZEY3Wb9Caq4HWiTxKJOVF75WFXdnJWxUHgQ/4=; b=S72FjPCZxmXK E01QWu2PH4Y0/5nosO15Ks7siZpJNudckzwe/4QlGppNlXurt/BPu7q1QqU4gut+B8sIMe6WCkZjZ 4ohaeIap/J34cMjEefJmd9GdMhEBGD0IiCdPYYfYkT3BNgx+jMMl60Lio63MDQ31DoK79xAdIir8B ZPZHpxJh8sjnP9S6oTVBXOpecXDZUXdUsMdzsPsZFJrVnlKY3lPUMzeCLlZJU6W/zmGXX5SHrs7I7 zZ+KgnI3t+fRsZoMxzr8d0yqHBQ1MC0hHgGloNoam3QQBeHB3r/lDvhFdYrB30vn055JXoGlUmD/V +M7gTQPNG1XH0FmZw70zgQ==; 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 1ovweL-0003Ya-2F; Fri, 18 Nov 2022 03:23:01 -0500 Date: Fri, 18 Nov 2022 10:23:04 +0200 Message-Id: <8335agd63b.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Fri, 18 Nov 2022 00:05:47 -0500) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Richard Stallman > Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, > dima@secretsauce.net > Date: Fri, 18 Nov 2022 00:05:47 -0500 > > There are supposed to be GDB options it can specify on startup to get > the right behavior from GDB. Is there some such option that is > missing from GDB? No. GDB behaves correctly and as expected. The issue is with GUD, specifically how GUD sets the default-directory of the buffer through which the user interacts with GDB. Here's the doc string which describes this subtlety: (defun gud-gdb (command-line) "Run gdb passing it COMMAND-LINE as arguments. If COMMAND-LINE names a program FILE to debug, gdb will run in a buffer named *gud-FILE*, and the directory containing FILE becomes the initial working directory and source-file directory for your debugger. If you don't want `default-directory' to change to the directory of FILE, specify FILE without leading directories, in which case FILE should reside either in the directory of the buffer from which this command is invoked, or it can be found by searching PATH. The above means that the default-directory of the *gud-FILE* buffer will be different depending on whether at gud-gdb's prompt you type the GDB command with the program to debug in its absolute file-name form: gdb ... /foo/bar/baz ... or you type gdb ... baz ... and let GDB find 'baz' by searching PATH. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 20:15:48 2022 Received: (at 58826) by debbugs.gnu.org; 20 Nov 2022 01:15:49 +0000 Received: from localhost ([127.0.0.1]:41873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owYw0-0000Rn-Hk for submit@debbugs.gnu.org; Sat, 19 Nov 2022 20:15:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owYvy-0000RT-6Y for 58826@debbugs.gnu.org; Sat, 19 Nov 2022 20:15:46 -0500 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 1owYvs-0005HB-Ts; Sat, 19 Nov 2022 20:15:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=+Mykv8XQnKTZvj0MTxgKE+GRjm5jFbAUbnYGKH4dJzE=; b=QU6SJrxcbqva 04ODNNzmztj4uLWrcFeyknmGILDCVxxjxUgITBkDfCJu1G/+glc98Mc1ssgN/w2HTP7m/uEhx2tCW x9/Jf3byuMoC/Eq67+ZqVWK2LV2bcjNf+u2fuEyPuYC3B2ZA1hoE0exSAsVeIObUNBnNeZRJEnbcp Heta3eFPnYgi9v06Unym6yfY7lvQVPrhEt2ebvLVElrPArW/KamGPbo+Ktzi1C4AfP0+CpLXJnZL+ 4/Jly40H/fkWNzCZaDoV3SZnvRb2c9xxOZ5wA8YdZxPS1JlSb7NEtuykgpoOs9nNFkLoEO1yBu8KQ k64vQsRLiZEjOZ6V/ol90w==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1owYvs-00045w-59; Sat, 19 Nov 2022 20:15:40 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <8335agd63b.fsf@gnu.org> (message from Eli Zaretskii on Fri, 18 Nov 2022 10:23:04 +0200) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> Message-Id: Date: Sat, 19 Nov 2022 20:15:40 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > The above means that the default-directory of the *gud-FILE* buffer > will be different depending on whether at gud-gdb's prompt you type > the GDB command with the program to debug in its absolute file-name > form: > gdb ... /foo/bar/baz ... > or you type > gdb ... baz ... > and let GDB find 'baz' by searching PATH. Indeed, that can happen. But does GDB have a command to specify the file name of the core dump? It ought to. If it does, can you override that mistaken heuristic choice by specifying the complete file name of the core dump? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 02:45:04 2022 Received: (at 58826) by debbugs.gnu.org; 20 Nov 2022 07:45:05 +0000 Received: from localhost ([127.0.0.1]:42248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owf0i-0001vC-KJ for submit@debbugs.gnu.org; Sun, 20 Nov 2022 02:45:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owf0h-0001uR-8W for 58826@debbugs.gnu.org; Sun, 20 Nov 2022 02:45:03 -0500 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 1owf0b-0003w7-MY; Sun, 20 Nov 2022 02:44:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=poFa/A9ft0J30pQLzrjbrJNkCT+3TwIeCEYgKgFx270=; b=Whvb9Anrqzw+ dI0g740KUZQTfU0RjV/LeBW4PwDHzKSEWpjiH/DaZhCYA6121rpXWJaRckrWLqRIwumv/TXrEjXPL ooa2PTr0s+n3srI2yWofWiqZIRbEb54CVNFK3ApKZBmbFnBKJlFuTfGDPGZIzDhELtX72d7sS/NXq MLOYVTiCJzWxSpVx53Wzo5+1wA99qObVhmxSlA1uGqYUqvtnL9fnO68hSpSl4ubpoofZLZmrNMgU3 NCbrjRAcK0VkwYIFCScl71ndcl1gwjz6ldnIBieAvyJZ5DYsmMgrw6apGJSYdaMGnSdknwX/wpgka XTWOur3VJACoQyFiZpPK7w==; 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 1owf0X-0006S1-AI; Sun, 20 Nov 2022 02:44:54 -0500 Date: Sun, 20 Nov 2022 09:45:02 +0200 Message-Id: <83wn7q5atd.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Sat, 19 Nov 2022 20:15:40 -0500) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Richard Stallman > Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, > dima@secretsauce.net > Date: Sat, 19 Nov 2022 20:15:40 -0500 > > > The above means that the default-directory of the *gud-FILE* buffer > > will be different depending on whether at gud-gdb's prompt you type > > the GDB command with the program to debug in its absolute file-name > > form: > > > gdb ... /foo/bar/baz ... > > > or you type > > > gdb ... baz ... > > > and let GDB find 'baz' by searching PATH. > > Indeed, that can happen. > > But does GDB have a command to specify the file name of the core dump? Yes, it does. > If it does, can you override that mistaken heuristic choice by specifying > the complete file name of the core dump? No, because the default-directory of the *gud-FILE* buffer is already set by the time you get the GDB prompt. You can, of course, "M-x cd" in the buffer. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 23 18:16:48 2022 Received: (at 58826) by debbugs.gnu.org; 23 Nov 2022 23:16:48 +0000 Received: from localhost ([127.0.0.1]:56557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxyz1-0005KN-Sz for submit@debbugs.gnu.org; Wed, 23 Nov 2022 18:16:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxyyz-0005K9-Ec for 58826@debbugs.gnu.org; Wed, 23 Nov 2022 18:16:46 -0500 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 1oxyyt-0002r4-TA; Wed, 23 Nov 2022 18:16:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=EVEbw0Kc4esZ1ARw6BRNymDVAVLgYzvG+653Cl98z60=; b=QuAb9Mq7LdRw ZSAswtzb/3GcgsPI4NkVr0SXsa0AWCih26gYbe9ixq3EPFu1fUH6MtE1SbKAOtX5i6Ew9XihSBvBF VB+Pd62NVzQQIrkN9aITi+D4DppjIJUqk2pQvwYgrirP4zz1adQlTw0ZPQxgCpLflqViEbssoU7sf oKP8BG9GTkjZfUDXzO+kCvhtERpJEmoikXA8JfcL0QD7lLW5tJ+Iu0HIfsUkw862NuYRIhPkHxOdi Ys2DM///U0ofXrYURoYU0B+/OEpDHkunHXZBVKn/e/AiefE1yuw2Ee0NCAmuoogc8ungsWLtV/mvC OslIl9UDwiYmk8zlSwa+zw==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1oxyyh-0003h7-K0; Wed, 23 Nov 2022 18:16:27 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83wn7q5atd.fsf@gnu.org> (message from Eli Zaretskii on Sun, 20 Nov 2022 09:45:02 +0200) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> Message-Id: Date: Wed, 23 Nov 2022 18:16:27 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > No, because the default-directory of the *gud-FILE* buffer is already set by > the time you get the GDB prompt. > You can, of course, "M-x cd" in the buffer. Could we fix this by adding a new option to GDB to specify the working directory? The gud.el could use that option if it sees that GDB's default choice for working directory would not be correct. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 23 18:20:35 2022 Received: (at 58826) by debbugs.gnu.org; 23 Nov 2022 23:20:35 +0000 Received: from localhost ([127.0.0.1]:56568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxz2g-0005QL-Sb for submit@debbugs.gnu.org; Wed, 23 Nov 2022 18:20:35 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxz2g-0005Q7-3E for 58826@debbugs.gnu.org; Wed, 23 Nov 2022 18:20:34 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 097CE5C00C7; Wed, 23 Nov 2022 18:20:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 23 Nov 2022 18:20:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1669245629; x=1669332029; bh=K8 do4C+TD+h9fP1lUL7yIgCUipbwCRWDnN3wzptosLw=; b=Ff+Zp4IIpF++Y3WpnL S45TIFhG9PYmpLcbcJHEU4F1tFIfMBRJE3nratgos6mi3pJYvWm+ByqotStOSkvf Qao1GXCro6wPcSrkvgIVn1jCw3bhmuEm+4iDGEMp2x0/OhrGJEUKz0yRZrjZmNLx K2q6ybAnG1hnuWpUv+sKbu8K+X2JZ+YDb2S2pk4ag9oH2tHdSy4un4WYraWMxIh/ 4uv3qpTrbyhISAhIxFY0DOHe3sBlVA7y1PsKUsvPEGoX7rt2AZLK7KKwjqmP5yDk iKw3sK5XXt2VQlFI0X21pcDlvfrsNSPA1KQ1x5hV5Z+l+8lmdM4EowPp9zF4hw15 cYBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669245629; x=1669332029; bh=K8do4C+TD+h9fP1lUL7yIgCUipbw CRWDnN3wzptosLw=; b=j6R6CwevKz69D3bePqaZmXkGf9mze7RBS0SXFJIbFnh4 z0aYU+wDLEdJkuDCNOxlsCO9OcttZiQ7Jx/iXclCyT65RNIJP3IUk7PThDCcphze ilpUox4HI94mDPbpma9kQpgyjbYaUoBytZ3KC8KgF1tLIlhsW43jKJWf5vCjbLuZ tKNVwomNu6IIykUvx4FV4mlaQd9U0LMucFhcc3bhOmp4lmr02yr80rtgR91KphUS DA6SPefbSDxPzJxisjlQhOeY+0U/3p2tSL0G8ZcWlbeFkNULwYuPbwAhswl2J4gZ jliyLAx7fWTHtOPNI5y89VNANooc4WYjjfXaPqKXDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedriedvgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeffihhmrgcu mfhoghgrnhcuoeguihhmrgesshgvtghrvghtshgruhgtvgdrnhgvtheqnecuggftrfgrth htvghrnhepgfeifeehgedvkeekvdevvdelvdegleevtedvueejvdejveduveeuleevleev udetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug himhgrsehsvggtrhgvthhsrghutggvrdhnvght X-ME-Proxy: Feedback-ID: i3e8042a0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Nov 2022 18:20:28 -0500 (EST) References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> User-agent: mu4e 1.8.10; emacs 29.0.50 From: Dima Kogan To: rms@gnu.org Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory Date: Wed, 23 Nov 2022 15:17:49 -0800 In-reply-to: Message-ID: <87tu2pp8au.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58826 Cc: Eli Zaretskii , stefankangas@gmail.com, 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Richard Stallman writes: > Could we fix this by adding a new option to GDB to specify the working > directory? This exists: you can "gdb --cd DIR" But that doesn't matter: this is a gud issue. The complaint was that running "gdb ARGS" in a shell sometimes doesn't do the same thing as M-x gud "gdb ARGS", even with the same ARGS From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 01:55:43 2022 Received: (at 58826) by debbugs.gnu.org; 24 Nov 2022 06:55:43 +0000 Received: from localhost ([127.0.0.1]:56979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oy699-0002dG-18 for submit@debbugs.gnu.org; Thu, 24 Nov 2022 01:55:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oy697-0002d2-BZ for 58826@debbugs.gnu.org; Thu, 24 Nov 2022 01:55:41 -0500 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 1oy691-0000zh-VQ; Thu, 24 Nov 2022 01:55:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tLqpeqj06JKaJytTwQrDl1yPhhXEpku6+Z4L7YOw8rw=; b=cWWxbtA9KDGq cBdkJGtU8b5czYjwttHXHr0opsdVDvvxtr+e/rDy35jviVx2AZVEilTMcItouUosZ2ZC7IDwBaxRX xN5ZtJlykgxToxQ5DuksdZbSPmKkk/pw5P2KWYOc+A865b70aL62u0G+nEAmmVCm7tEGVTFxhHb1m RAioMZAFs4YJpLFtqDSWxdg7PZHtE29A3AUhqdB6jhnlADTBm9Q9XHts/VeWxvOwnPBFKsM6du2kp xj40g2n9UIkHvqpbQiPei9ha2TKd/IHnAmqdC2ByPa60v0I5HzzjaMrVUI7a7QdcXmuSa6Lr2XOHh YkHUNJzNhEOH/dfE1d6/4w==; 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 1oy68w-0007ks-Oc; Thu, 24 Nov 2022 01:55:31 -0500 Date: Thu, 24 Nov 2022 08:55:48 +0200 Message-Id: <83h6yoyh6z.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Wed, 23 Nov 2022 18:16:27 -0500) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Richard Stallman > Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, > dima@secretsauce.net > Date: Wed, 23 Nov 2022 18:16:27 -0500 > > > No, because the default-directory of the *gud-FILE* buffer is already set by > > the time you get the GDB prompt. > > > You can, of course, "M-x cd" in the buffer. > > Could we fix this by adding a new option to GDB to specify the working > directory? The gud.el could use that option > if it sees that GDB's default choice for working directory > would not be correct. GDB already has a --cd=DIR option. If the user wants, he or she can use that by editing the GDB invocation command line at the gud.el's prompt. However, there's a fundamental misunderstanding here: this is not about the directory which GDB uses as its current directory, this is about the default-directory of the *gud-FILE* buffer in Emacs. That default-directory is set by gud.el _regardless_ of what GDB considers as cwd. The logic that sets the default-directory of the *gud-FILE* buffer is entirely in gud.el. Telling GDB to chdir to another directory will not affect the default-directory of the *gud-FILE* buffer, and that was the OP's problem: the fact that typing a relative file name was interpreted relative to a directory he didn't expect. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 25 19:50:23 2022 Received: (at 58826) by debbugs.gnu.org; 26 Nov 2022 00:50:23 +0000 Received: from localhost ([127.0.0.1]:37457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyjOh-0000M7-22 for submit@debbugs.gnu.org; Fri, 25 Nov 2022 19:50:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyjOe-0000Lu-NG for 58826@debbugs.gnu.org; Fri, 25 Nov 2022 19:50:21 -0500 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 1oyjOZ-00050m-E2; Fri, 25 Nov 2022 19:50:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=ACrgT8rRk0n2rLnGzxVHTQR/JwOEhO2Skd68g0zwmUE=; b=d9SqxklhFPyQ bk4eC7aWLut6VKaWwdwdV4LISepLcdHbaJ48WtXqF82Y3e6s9bvkh+URFes8FnQqS81kTGIVuXpel Rgydc//P6pZibzEfPrbaq7uMF7yTd72C44nKGwnAv0p6o/hU6ZI3wwOAwpzV7mSgsYCeIajLjjXzI IMDmOa+/cEDj4OSlZS7+J1T8hf6se6S9WiH3zwuYjWstJHJQkDG0wkOTyTCjuFQ1YJCeuMRy8Ek4u StV2jUurhFiQ4xy7pP0kD2T7XULCt9B14Ow46r8YOeM57tTjAjsKu0zkp/Q6wkHAiOgOBWX7GEd1+ w6kOQb9R44+KpuTqZb0xYQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1oyjOW-0004MD-Vt; Fri, 25 Nov 2022 19:50:12 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Dima Kogan In-Reply-To: <87tu2pp8au.fsf@secretsauce.net> (message from Dima Kogan on Wed, 23 Nov 2022 15:17:49 -0800) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> <87tu2pp8au.fsf@secretsauce.net> Message-Id: Date: Fri, 25 Nov 2022 19:50:12 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: eliz@gnu.org, stefankangas@gmail.com, 58826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > Could we fix this by adding a new option to GDB to specify the working > > directory? > This exists: you can "gdb --cd DIR" I figured there would be one. However, is that what we want in this case? Do we want GDB to run with a different working directory, or only to find the core file in that directory? > But that doesn't matter: this is a gud issue. The complaint was that > running "gdb ARGS" in a shell sometimes doesn't do the same thing as M-x > gud "gdb ARGS", even with the same ARGS The question is, why not fix this with a change in GUD? People were talking about an obstacle to doing so, but I didn't see a clear statement of what the obstacle was. It seemed to be about whether GUD can tell GDB to find the core dump in the right place. If --cd enables GDB to find the core dump in the right place, why not make GUD send that argument? Does that fail to do the job right? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 22:14:22 2022 Received: (at 58826) by debbugs.gnu.org; 29 Dec 2022 03:14:23 +0000 Received: from localhost ([127.0.0.1]:59087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAjN8-0000KE-J0 for submit@debbugs.gnu.org; Wed, 28 Dec 2022 22:14:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAjN6-0000Js-F1 for 58826@debbugs.gnu.org; Wed, 28 Dec 2022 22:14:21 -0500 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 1pAjN1-00005o-2t; Wed, 28 Dec 2022 22:14:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=8FtRmNELyXt3JAPVQMIerMMDIECDIakzV5hYbYyDyWo=; b=IBfChcBLM+u+ 61NeTJHOzplPPMzT7ASzdukRO72CqUyXc5hX4aRTOCXmBPjfsKLhhB9HtQau1U+1Vb3YWjAsvOzNW nFYLkkq1eR1yeyXTm1/FSrxAj7cdAjOrxLXjNe3PupvFc2Lap7Rf5SpYGi7JhyHA4YKDZSuBuxKo4 Ul3Q93jasAlKT1DV3BpZw2QV73MjI8eGQmzR85fBifqroCKtjhrpR1e7ksXgk3GL2OTEd8VFY123N Ip8l4RXZNsNxGwbS8bqpHTO3EqZkfP+9KWZmIuDiBmyjTK+WDMOTOiucu3RlornrEnX0BBs5/p+Od 8AIAKkTePO1GSVmkKVsQyQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1pAjN0-0007q0-OX; Wed, 28 Dec 2022 22:14:14 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83h6yoyh6z.fsf@gnu.org> (message from Eli Zaretskii on Thu, 24 Nov 2022 08:55:48 +0200) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> <83h6yoyh6z.fsf@gnu.org> Message-Id: Date: Wed, 28 Dec 2022 22:14:14 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Telling GDB to chdir to another directory will not affect the > default-directory of the *gud-FILE* buffer, and that was the OP's problem: > the fact that typing a relative file name was interpreted relative to a > directory he didn't expect. It must be Emacs Lisp code that creates the *gud-FILE* buffer and handles these relative file name. Can't that code be changed to DTRT? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 01:20:15 2022 Received: (at 58826) by debbugs.gnu.org; 29 Dec 2022 06:20:15 +0000 Received: from localhost ([127.0.0.1]:59155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAmH1-0005sU-4a for submit@debbugs.gnu.org; Thu, 29 Dec 2022 01:20:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAmGz-0005sD-Ay for 58826@debbugs.gnu.org; Thu, 29 Dec 2022 01:20:13 -0500 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 1pAmGt-0004uh-Ck; Thu, 29 Dec 2022 01:20:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=flFzG+mpVYi/IhqNQYZoxxTAOg8Lu6Gfiau8RyfwL2s=; b=nfZbM0Gy5vUR YopbToqT//MDHeqXDc9uuNzIGnuX026bcs1V0+Fuus0RJYGr1/IpDRHEYymK7AAYZlHkSqu+0T0sZ yEoEFhy2D9tyIjc97ssm+SqlPfKPcmQWACaitw/CCDt6KiP0476Bwt6fdtAzJ589OezAq+McdthfK JN/INOgMBBa4CqCxK0qubPbpzrGopiH5LK0mluaq0Ng1lxoTTEck5H7N6MKyldtAAyWaFOCdWOs5h RpbmDTR/COpFqJ1n6drUrvjqQQSo7cyoMnUm6uOYIpO4aaNLYOXtHbLCs5037fo3oAdz4s0TKJ3Kj p5Oy9PJb5NjvZnG2yoPTzg==; 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 1pAmGY-0003wr-0r; Thu, 29 Dec 2022 01:19:49 -0500 Date: Thu, 29 Dec 2022 08:19:58 +0200 Message-Id: <83o7rm91f5.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Wed, 28 Dec 2022 22:14:14 -0500) Subject: Re: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> <83pmecjtxh.fsf@gnu.org> <83h6z0ib3j.fsf@gnu.org> <8335agd63b.fsf@gnu.org> <83wn7q5atd.fsf@gnu.org> <83h6yoyh6z.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58826 Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Richard Stallman > Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, > dima@secretsauce.net > Date: Wed, 28 Dec 2022 22:14:14 -0500 > > > Telling GDB to chdir to another directory will not affect the > > default-directory of the *gud-FILE* buffer, and that was the OP's problem: > > the fact that typing a relative file name was interpreted relative to a > > directory he didn't expect. > > It must be Emacs Lisp code that creates the *gud-FILE* buffer > and handles these relative file name. Can't that code be changed > to DTRT? The argument here, and the original problem, is about what is "TRT". For some (many) use cases, what the code does now is already TRT. I attempted to explain that up-thread: IME, the current behavior covers most of the use cases: either you are debugging a program you are developing from its source tree, or you are debugging an installed program that's on PATH. > It's also really unintuitive to have an implicit change of directory > here, and it would match most people's expectations if it was changed, I > think. Do you know why we're doing that? If you think about that, it's actually quite natural: it makes the files you are likely to access from the debug session appear in the current directory. In any case, this is a long-standing behavior.