From owner-freebsd-current Thu May 8 07:51:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA00885 for current-outgoing; Thu, 8 May 1997 07:51:14 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id HAA00880 for ; Thu, 8 May 1997 07:51:09 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id QAA13506 for current@FreeBSD.ORG; Thu, 8 May 1997 16:51:07 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id QAA25303; Thu, 8 May 1997 16:26:42 +0200 (MET DST) Message-ID: <19970508162641.DE47196@uriah.heep.sax.de> Date: Thu, 8 May 1997 16:26:41 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: current@FreeBSD.ORG Subject: Re: Problems using remote gdb References: <199705080042.KAA27367@godzilla.zeta.org.au> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199705080042.KAA27367@godzilla.zeta.org.au>; from Bruce Evans on May 8, 1997 10:42:23 +1000 Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Bruce Evans wrote: > No. The console driver doesn't know about low level consoles. There are > now 3 layers of consoles: > > /dev/console - an ordinary device, written to by syslogd, etc. > low level part of console driver - used for kernel printfs > low level consoles - lower than the console driver, called directly > by i386_gdbstub. So now, what has the handbook to be changed to? Bruce, reading the handbook isn't rocket science :), just in case you don't know how to use Lynx, here's the appropriate paragraphs: ------------------------------------------------------------------------ You should configure the kernel in question with config -g, include DDB into the configuration, and compile it as usual. This gives a large blurb of a binary, due to the debugging information. Copy this kernel to the target machine, strip the debugging symbols off with strip -x, and boot it using the -d boot option. Connect the first serial line of the target machine to any serial line of the debugging host. Now, on the debugging machine, go to the compile directory of the target kernel, and start gdb: % gdb -k kernel GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc... (kgdb) Initialize the remote debugging session (assuming the first serial port is being used) by: (kgdb) target remote /dev/cuaa0 Now, on the target host (that entered DDB right before even starting the device probe), type: Debugger("Boot flags requested debugger") Stopped at Debugger+0x35: movb $0, edata+0x51bc db> gdb DDB will respond with: Next trap will enter GDB remote protocol mode ------------------------------------------------------------------------ Somewhere there, the information about which flags to sio0 are required and which are useful should go. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)