Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 1998 13:30:36 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        "Jose' Carlos Brustoloni" <jcb@research.bell-labs.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Dropping into DDB when X server is active
Message-ID:  <Pine.BSF.3.95.980818131559.9917D-100000@current1.whistle.com>
In-Reply-To: <35D9D2F6.AC30DE26@research.bell-labs.com>

next in thread | previous in thread | raw e-mail | index | archive | help

basically if you are going to want to run X then you need to have the
debugging output be redirected to com1.

to do this you will need another device (terminal or PC) 
attached to com1 at 9600 baud and boot with -hd
-h toggles the console between com1 and the vga/keyboard
Note.. The keyboard may still drop you into the debugger with
<CTL><ALT><ESC> if you don't have X running, but the debugger will
appear on com1..
(use cu -l cuaa1 to see it)
(or tip or kermit or any other terminal program)

when it stops in the debugger (that's what -d does) then set your
breakpoint and continue.

don't forget to move your mouse to com2..

If you have another BSD machine then you can do even better....
compile the kernel on the 2nd machine with 
config -g
this will make a HUGE debug kernel.
copy it to kernel.strip and 
strip -d kernel.strip.
copy kernel.strip to the test machine
and boot that.

when you enter the debugger, type 'gdb'
then 
's'
a line of garbage will appear instead of the normal ddb prompt.
the is the gdb remote protocol.

go to the 2nd machine, to the compile directory (with the huge kernel)
type:
cat >.gdbinit <<DONE
file kernel
set remotebaud 9600
target remote  /dev/cuaa1
DONE

now type
gdb

you will find that you are now in gdb doing "source level" debugging
able to set breakpoints and single step etc, all with access to the
sources and all variables..

using xxgdb(ports) makes it even sweeter with the ability to 
use the graphical interface and watch the little arrow walk through the
source as the kernel single steps..


julian




On Tue, 18 Aug 1998, Jose' Carlos Brustoloni wrote:

> Hi,
> 
> I am using FreeBSD 2.2.6 on a Pentium II 266 MHz PC with 64 MB memory
> and Matrox Millenium II AGP video board. I am running the XFree86
> version that comes in the FreeBSD 2.2.6 release.
> 
> I compiled the kernel with options DDB, BREAK_TO_DEBUGGER,
> UCONSOLE, and GDB_REMOTE_CHAT. My .xinitrc file
> runs xterm with the -C flag (so that the initial xterm would grab
> the system console).
> 
> I am adding some modifications to the kernel and would like to be able to:
>  - set a breakpoint in DDB; continue;
>  - start X;
>  - run an application (Netscape) that causes the kernel breakpoint to be
>          reached; AND
>  - drop into DDB so that I can examine register, processes, etc.
> Unfortunately, when the breakpoint is reached, the system simply hangs
> instead of dropping into DDB.
> 
> I also would like to be able to drop into DDB by pressing Ctrl-Alt-ESC
> when the X server is running. Unfortunately, this key combination is
> ignored by the system unless the screen is in console mode.
> 
> Is there any way to use DDB when the X server is running?
> 
> Thanks,
> 
>     Jose'
> 
> 
> 
> 
> 
> 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980818131559.9917D-100000>