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 09:23:40 +0300 Message-ID: <83zgdgjwk3.fsf@gnu.org> References: <87wn8komdb.fsf@jpl.nasa.gov> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22835"; 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 08:34:49 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 1ooIx7-0005d8-7k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 08:34:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooIvO-0005Vp-LO; Fri, 28 Oct 2022 02:33:02 -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 1ooIvM-0005S3-Nr for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:33:00 -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 1ooImg-0000zE-Jz for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooImg-0002Ju-7E for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:24: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 06:24: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.16669382338904 (code B ref 58826); Fri, 28 Oct 2022 06:24:02 +0000 Original-Received: (at 58826) by debbugs.gnu.org; 28 Oct 2022 06:23:53 +0000 Original-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 Original-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 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 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==; 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 1ooImO-0001u4-Tg; Fri, 28 Oct 2022 02:23:45 -0400 In-Reply-To: <87wn8komdb.fsf@jpl.nasa.gov> (message from Dima Kogan on Thu, 27 Oct 2022 16:52:32 -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:246392 Archived-At: > 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.