help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kgdb in emacs


From: Nick Roberts
Subject: Re: kgdb in emacs
Date: Sun, 27 Jan 2008 23:51:10 +1300

 > > 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]