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: Thu, 24 Nov 2022 08:55:48 +0200 Message-ID: <83h6yoyh6z.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16716"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stefankangas@gmail.com, 58826@debbugs.gnu.org, dima@secretsauce.net To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 24 07:56:19 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 1oy69i-00049t-L0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Nov 2022 07:56:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oy69X-0005xJ-UW; Thu, 24 Nov 2022 01:56:07 -0500 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 1oy69T-0005wi-IV for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 01:56:05 -0500 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 1oy69S-00012m-N6 for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 01:56:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oy69S-0002dn-JC for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 01:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Nov 2022 06:56: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.166927294310126 (code B ref 58826); Thu, 24 Nov 2022 06:56:02 +0000 Original-Received: (at 58826) by debbugs.gnu.org; 24 Nov 2022 06:55:43 +0000 Original-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 Original-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 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 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==; 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 1oy68w-0007ks-Oc; Thu, 24 Nov 2022 01:55:31 -0500 In-Reply-To: (message from Richard Stallman on Wed, 23 Nov 2022 18:16:27 -0500) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248815 Archived-At: > 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.