From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: new gdb/gdba code has bug with absolute source filenames Date: Thu, 8 Jan 2004 10:21:47 +0000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <16381.12091.162795.324113@nick.uklinux.net> References: <16380.35732.41673.248437@nick.uklinux.net> <84vfnnb73l.fsf@cenderis.demon.co.uk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1073558950 21565 80.91.224.253 (8 Jan 2004 10:49:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2004 10:49:10 +0000 (UTC) Cc: Andreas Schwab , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jan 08 11:49:05 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeXir-0002LZ-00 for ; Thu, 08 Jan 2004 11:49:05 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeXir-0000ZP-00 for ; Thu, 08 Jan 2004 11:49:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeYeY-0008Ix-8z for emacs-devel@quimby.gnus.org; Thu, 08 Jan 2004 06:48:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AeYWl-0005Zx-FR for emacs-devel@gnu.org; Thu, 08 Jan 2004 06:40:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AeYUk-0004HZ-TV for emacs-devel@gnu.org; Thu, 08 Jan 2004 06:39:06 -0500 Original-Received: from [194.247.51.48] (helo=nick.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeYNq-0001Yi-AN for emacs-devel@gnu.org; Thu, 08 Jan 2004 06:31:26 -0500 Original-Received: by nick.uklinux.net (Postfix, from userid 501) id B5A0875FDE; Thu, 8 Jan 2004 10:21:47 +0000 (GMT) Original-To: Bruce Stephens In-Reply-To: <84vfnnb73l.fsf@cenderis.demon.co.uk> X-Mailer: VM 6.97 under Emacs 21.2.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19100 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19100 > > Bruce, when you see the assembler code for main rather than C source code > > what does GDB say when you type "info source" in the GUD buffer? > > It says: > > (gdb) info source > Current source file is /tmp/hello.c > Located in /tmp/hello.c > Contains 6 lines. > Source language is c. > Compiled with DWARF 2 debugging format. > Includes preprocessor macro info. Emacs doesn't find the source because "info source" doesn't output the line with the compilation directory. Compare this with: > Current source file is hello.c > Compilation directory is /tmp <- > Located in /tmp/hello.c > Contains 6 lines. > Source language is c. > Compiled with DWARF 2 debugging format. > Includes preprocessor macro info. I don't know if this is a bug in gdb or gcc or normal output. I don't see why gdb can't find the compilation directory from the executable. You used gcc version 3.3.3, is that a stable version? > Perhaps I'm being naive, but it looks to me like gdb-source-info ought > to be looking at "Located in ..." and just believing it. (Possibly > this wouldn't work for Windows or older gdbs or something.) It *does* use "Located in ...". Below is a patch that should work in your case. I'm not sure whether I should commit it to the repository though. Nick http://www.nick.uklinux.net *** gdb-ui.el.~1.54.~ 2004-01-07 23:04:35.000000000 +0000 --- gdb-ui.el 2004-01-08 10:09:17.000000000 +0000 *************** *** 1706,1719 **** buffers." (goto-char (point-min)) (if (search-forward "directory is " nil t) ! (progn ! (if (looking-at "\\S-*:\\(\\S-*\\)") ! (setq gdb-cdir (match-string 1)) ! (looking-at "\\S-*") ! (setq gdb-cdir (match-string 0))) ! (search-forward "Located in ") (looking-at "\\S-*") ! (setq gdb-main-file (match-string 0))) (setq gdb-view-source nil)) (delete-other-windows) (switch-to-buffer gud-comint-buffer) --- 1706,1718 ---- buffers." (goto-char (point-min)) (if (search-forward "directory is " nil t) ! (if (looking-at "\\S-*:\\(\\S-*\\)") ! (setq gdb-cdir (match-string 1)) (looking-at "\\S-*") ! (setq gdb-cdir (match-string 0)))) ! (if (search-forward "Located in " nil t) ! (if (looking-at "\\S-*") ! (setq gdb-main-file (match-string 0))) (setq gdb-view-source nil)) (delete-other-windows) (switch-to-buffer gud-comint-buffer)