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: gdb-ui problem Date: Thu, 2 Dec 2004 17:09:45 +1300 Message-ID: <16814.38281.565906.640095@farnswood.snap.net.nz> References: <5065e29004113020007fdd4d76@mail.gmail.com> <16814.12683.163550.573169@farnswood.snap.net.nz> <5065e29004120117356b09f8d1@mail.gmail.com> 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 1101961026 29172 80.91.229.6 (2 Dec 2004 04:17:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Dec 2004 04:17:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 02 05:17:01 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CZiOq-0006aP-00 for ; Thu, 02 Dec 2004 05:17:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CZiYN-0000yQ-J1 for ged-emacs-devel@m.gmane.org; Wed, 01 Dec 2004 23:26:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CZiXw-0000xD-Tf for emacs-devel@gnu.org; Wed, 01 Dec 2004 23:26:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CZiXw-0000wv-51 for emacs-devel@gnu.org; Wed, 01 Dec 2004 23:26:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CZiXv-0000wl-Vr for emacs-devel@gnu.org; Wed, 01 Dec 2004 23:26:24 -0500 Original-Received: from [202.124.108.155] (helo=farnswood.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CZiOG-00009R-HW for emacs-devel@gnu.org; Wed, 01 Dec 2004 23:16:25 -0500 Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 216EB627EE; Thu, 2 Dec 2004 04:09:46 +0000 (GMT) Original-To: Sun Yijiang In-Reply-To: <5065e29004120117356b09f8d1@mail.gmail.com> X-Mailer: VM 6.97 under Emacs 21.2.1 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: main.gmane.org gmane.emacs.devel:30598 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30598 [Please use reply-to-all so the thread keeps going to the mailing list] > > > I think this needs to be fixed, gdb-ui's behavior should be like ddd, who > > > will ask gdb for file paths it cannot find under current directory. > > > > What version are you using? I can't see this feature in GNU DDD 3.3.1. > > I'm using the same version as yours. Pay attention to it's status > line, you can see when you select "Open Source" from menu and click on > a file, the status line will display the file's absolute path, and > when you click "open", DDD will open it. Some time DDD said the file > is "not found", and then it will read the file "from GDB". After all, > DDD promises to find out any source file you can see from "info > sources" command in GDB. OK, I misunderstood. I thought you were talking about finding files during execution. > It's better to say I'm studying it ^_^ I found there's no easy way to > get a source file's absolute path. Now I can only use "list this.cpp" > and then "info source" to check the absolute path of "this.cpp", but > there is no annotation infomation. I'm wondering how DDD make it. DDD uses "gdb -fullname", sometimes called level 1 annotatons. You can see some of the commands that it runs behind the users back by typing "show commands 5", "show commands +"... in the console window. I guess it just parses the output of "info source". You could something similar to that in gdb-ann3, for finding the source containing the main routine (gdb-main-file) e.g (gdb-enqueue-input (list "server list this.cpp\n" 'ignore)) (gdb-enqueue-input (list "server info source\n" 'gdb-find-file)) gdb-find-file acts as a handler for "info source" and can access its output in the partial-output buffer. However, I'm not sure how gdb-find-file should work so that it doesn't interfere with find-file. Also, note that I haven't tested this mode with C++ (I have had a report that it doesn't always parse the breakpoints table correctly for the breakpoints buffer). Nick