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, 18 Nov 2022 10:23:04 +0200 Message-ID: <8335agd63b.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32388"; 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 Fri Nov 18 09:24:26 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 1ovwfh-0008Gy-FX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 09:24:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovwfV-0007Y8-AK; Fri, 18 Nov 2022 03:24:13 -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 1ovwfK-0007Xg-Kc for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 03:24:02 -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 1ovwfK-0005yb-CT for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 03:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovwfK-0005Ox-7t for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 03:24: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: Fri, 18 Nov 2022 08: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.166875979020706 (code B ref 58826); Fri, 18 Nov 2022 08:24:02 +0000 Original-Received: (at 58826) by debbugs.gnu.org; 18 Nov 2022 08:23:10 +0000 Original-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 Original-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 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 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==; 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 1ovweL-0003Ya-2F; Fri, 18 Nov 2022 03:23:01 -0500 In-Reply-To: (message from Richard Stallman on Fri, 18 Nov 2022 00:05:47 -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:248182 Archived-At: > 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.