From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.help Subject: Re: kgdb in emacs Date: Sun, 27 Jan 2008 23:51:10 +1300 Message-ID: <18332.25118.870355.870079@kahikatea.snap.net.nz> References: <18332.19879.672102.308829@kahikatea.snap.net.nz> <175841.40216.qm@web57709.mail.re3.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201431117 9904 80.91.229.12 (27 Jan 2008 10:51:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jan 2008 10:51:57 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Sanjeev Kumar.S" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 27 11:52:18 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JJ57Y-0006KW-Cu for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Jan 2008 11:52:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJ577-0005Qj-RY for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Jan 2008 05:51:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJ56q-0005PH-5l for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 05:51:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJ56n-0005Ox-Oe for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 05:51:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJ56n-0005Ou-J9 for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 05:51:29 -0500 Original-Received: from viper.snap.net.nz ([202.37.101.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJ56m-0005uo-TS for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 05:51:29 -0500 Original-Received: from kahikatea.snap.net.nz (162.63.255.123.dynamic.snap.net.nz [123.255.63.162]) by viper.snap.net.nz (Postfix) with ESMTP id CA86D3DA4B5; Sun, 27 Jan 2008 23:51:16 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 433578FC6D; Sun, 27 Jan 2008 23:51:12 +1300 (NZDT) In-Reply-To: <175841.40216.qm@web57709.mail.re3.yahoo.com> X-Mailer: VM 7.19 under Emacs 23.0.60.5 X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51007 Archived-At: > > Is "target remote /dev/cuad0" a valid kgdb command? > > Again, I was not able to get to this point without specifying the > complete set of arguments while starting. ie. to start i need to specify > -r and the debug file. without that i was not able to start it up. I thought maybe the kernel had a remote stub compiled into it and you could connect through that. But I know too little about kgdb, so you really need to ask Hidetoshi Shimokawa. > > Run gdb ( like this ) : kgdb -a -a -a -r /dev/cuad0 kernel.debug > > Just -a works for me. "-a -a" or "-a -a -a" and I get some garbled output > on the screen. But still I have an issue, I have to press a "n" or "s" to > get emacs to display the source file. Any way around it ? Presumably just "-a" gives you text command mode and not the other buffers that the screenshot I referred to has (M-x gdb-many-windows will show them if you are in graphical mode). To see what kgdb is doing run kgdb -a -r /dev/cuad0 kernel.debug and perhaps kgdb -a -a -a -r /dev/cuad0 kernel.debug from the command line. With GDB, Emacs uses the marker ^Z^Z to parse the file and line number: (gdb) b main Breakpoint 1 at 0x804862c: file myprog.c, line 95. (gdb) r Starting program: /home/nickrob/myprog Breakpoint 1, main (argc=1, argv=0xbfcfbfd4) at myprog.c:95 ^Z^Z/home/nickrob/myprog.c:95:1274:beg:0x804862c (gdb) kgdb should output something similar. However, I guess the kernel in your case is already running, so maybe it's a bit like attaching to a process and perhaps the first marker is missing. > > One last thing, if you do get it to work well, please e-mail me what you > > have learnt so that I can add it to my homepage. > > Yes...I will do this. I will make a complete document and give one copy > to you and one to the Freebsd doc team. But I will try and get as much > questions resolved in the document, so no one has to waste almost > a day figuring it out like me. Thanks. -- Nick http://www.inet.net.nz/~nickrob