cuaa0 or cuad0?

Lonnie VanZandt lonnie.vanzandt at ngc.com
Fri Aug 26 14:24:56 GMT 2005


fyi, the handbook is now outdated. The instructions therein applied up to 5.2 
(perhaps even to 5.3 but I didn't have to do a remote debug session in 5.3).

Most of it remains pertinent but the host-side gdb application was switched to 
"kgdb".

If you want to debug a remote target instead of a local running or core dumped 
kernel, your command-line options are:

	kgdb -r <com device> <path to local image of remote kernel>

The handbook instructions about sio flags (0x80) for the target remain 
correct. The target kernel also must have "options DDB", "options KDB", and 
"options GDB" in its configuration.

I run my com ports at 9600-8-N-1. Perhaps this can be increased on each 
side...

To connect the host and the target, enter kdb/ddb on the target (sysctl, 
keystroke, or panic), then type "gdb" on the target, then "s" on the target. 
Now, on the host, run the kgdb command with the proper paths to your com port 
and your kernel image. It should connect (if not, make sure you used a 
null-modem cable between the systems!)

To get the proper symbol table information for kgdb, sometime while the target 
is still up, run "asf" (see the man page for this) to output the 
add-symbol-file commands for any loaded modules. (The format of these 
commands changed a wee bit from 5.2 to 5.4 so asf helps to get the syntax and 
addresses correct.)

You can then "source asf.out" on the host kgdb session to load in your symbol 
tables. You'll need copies of the modules from the target on the host side 
too.

You can get remote kernel debugging to work - just be aware that none of the 
existant documentation really covers the scenario well. It all seems to focus 
on the "debug a core from a local kernel, single-system" use case...
On Friday 26 August 2005 07:36 am, Omer Faruk Sen wrote:
> root at balli# dumpon -v /dev/ad0s1b
> kernel dumps on /dev/ad0s1b
>
> And I have read
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kernel
>d ebug-online-gdb.html
> and I think this page should be updated. -k option on gdb is invalid and I
> assume I should kgdb command directly.
>
> Mike Tancsa writes:
> > At 09:20 AM 26/08/2005, Omer Faruk Sen wrote:
> >> By the way whatever I do with dumpdev on rc.conf. I couldn't get a crash
> >> dump on my /var/crash. What I do is to just enable dumpdev="/dev/ad0s1b"
> >> and dumpdir="/var/crash". Am I missing something? I have used 6.0BETA3
> >> and 6.0BETA2 GENERIC kernels for debugging,
> >
> > Do you have enough swap ?  What happens if you do
> > dumpon -v /dev/ad0s1b
> >
> > does it complain ?
> >
> >         ---Mike
> >
> >> -----------------------
> >> Omer Faruk Sen
> >> http://www.EnderUNIX.ORG
> >> Software Development Team @ Turkey
> >> http://www.Faruk.NET
> >> For Public key: http://www.enderunix.org/ofsen/ofsen.asc
> >> ********************************************************
> >>
> >> First Turkish Qmail book is out! Go check it.
> >> Duydunuz mu! Turkiye'nin ilk Qmail kitabi cikti.
> >> http://www.acikakademi.com/catalog/qmail/
> >> _______________________________________________
> >> freebsd-current at freebsd.org mailing list
> >> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> >> To unsubscribe, send any mail to
> >> "freebsd-current-unsubscribe at freebsd.org"
> >
> > _______________________________________________
> > freebsd-current at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to
> > "freebsd-current-unsubscribe at freebsd.org"
>
>  -----------------------
> Omer Faruk Sen
> http://www.EnderUNIX.ORG
> Software Development Team @ Turkey
> http://www.Faruk.NET
> For Public key: http://www.enderunix.org/ofsen/ofsen.asc
> ********************************************************
>
>
> First Turkish Qmail book is out! Go check it.
> Duydunuz mu! Turkiye'nin ilk Qmail kitabi cikti.
> http://www.acikakademi.com/catalog/qmail/
>
> _______________________________________________
> freebsd-current at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"



More information about the freebsd-current mailing list