From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58826: 29.0.50; gud-gdb can't find core file if executable is in a different directory Date: Fri, 28 Oct 2022 10:20:26 +0300 Message-ID: <83pmecjtxh.fsf@gnu.org> References: <87wn8komdb.fsf@jpl.nasa.gov> <83zgdgjwk3.fsf@gnu.org> <87y1t0mp40.fsf@secretsauce.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58826@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 09:21:55 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooJgh-000948-KO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 09:21:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooJgR-0005lU-Tn; Fri, 28 Oct 2022 03:21:39 -0400 Original-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 1ooJfr-0005Tp-40 for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 03:21:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooJfq-0002NH-Si for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 03:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooJfq-0003rn-BS for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 03:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2022 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58826 X-GNU-PR-Package: emacs Original-Received: via spool by 58826-submit@debbugs.gnu.org id=B58826.166694164514834 (code B ref 58826); Fri, 28 Oct 2022 07:21:02 +0000 Original-Received: (at 58826) by debbugs.gnu.org; 28 Oct 2022 07:20:45 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: <87y1t0mp40.fsf@secretsauce.net> (message from Dima Kogan on Thu, 27 Oct 2022 23:29:37 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246398 Archived-At: > 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.