From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: gud-chdir-before-run Date: Wed, 03 Mar 2010 05:25:11 -0500 Message-ID: <7rzl2pbt2w.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267611930 17190 80.91.229.12 (3 Mar 2010 10:25:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Mar 2010 10:25:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 03 11:25:27 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nmlld-0004ju-18 for ged-emacs-devel@m.gmane.org; Wed, 03 Mar 2010 11:25:25 +0100 Original-Received: from localhost ([127.0.0.1]:56043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmllc-0005xH-BS for ged-emacs-devel@m.gmane.org; Wed, 03 Mar 2010 05:25:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmllS-0005xC-No for emacs-devel@gnu.org; Wed, 03 Mar 2010 05:25:14 -0500 Original-Received: from [199.232.76.173] (port=45100 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmllR-0005x4-O7 for emacs-devel@gnu.org; Wed, 03 Mar 2010 05:25:13 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmllQ-0000MS-Ds for emacs-devel@gnu.org; Wed, 03 Mar 2010 05:25:13 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:33395) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmllQ-0000MO-6o for emacs-devel@gnu.org; Wed, 03 Mar 2010 05:25:12 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NmllQ-0003Tt-2I for emacs-devel@gnu.org; Wed, 03 Mar 2010 05:25:12 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121597 Archived-At: Why is this option's default value non-nil? It does the wrong thing when the executable is not in the same directory as the sources, because the .gdbinit file is usually found where the sources live, so changing the directory starts GDB in the wrong place, and .gdbinit is not read. In my usage, I normally type "M-x gdb" from a buffer that visits some source file which is compiled into the program I'm about to debug, or one of its Makefile's or other scripts. For this use-case, the current default is always wrong. But my main problem with this default is that the effect is different for the same command line, depending on whether you invoke GDB from the shell prompt or via "M-x gdb RET". Of course, customizing the option to nil is easy enough, but if there are no important use-cases where it does TRT, perhaps we should consider changing the default. Or maybe we should dynamically decide whether to chdir or not, depending on whether the executable mentioned in the GDB command line is in the same directory as the current buffer.