Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Sep 2001 13:37:06 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kernel ddb/gdb help
Message-ID:  <Pine.BSF.4.21.0109051306490.24154-100000@InterJet.elischer.org>
In-Reply-To: <Pine.SOL.4.21.0109051517270.6571-100000@onyx>

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


On Wed, 5 Sep 2001, Zhihui Zhang wrote:

> 
> 
> On Wed, 5 Sep 2001, Julian Elischer wrote:
> > 
> > WHen I have one machine I usually debug by running the new kernel
> > within a VMWARE virtual machine. Using the nmdm driver
> > you can run gdb in the main machine to debug it, all within one machine.
> > (unfortunatly it doesn't help for debugging drivers because the virtual
> > machine doesn't have acces to the real hardware).
> 
> I am interested in setting up this environment. Is there any help
> information out there? If not, can you give me a few guideline? I will try
> myself.
> 

first you need to get vmware running on your machine.
(use the vmware2 port)
(I select host-only (non bridged) networking)

then you boot and install FreeBSD on the machine.

then in the virtual machine, set in the file
/boot/device.hints

the line:
hints.sio.1.flags="0xc0"

in the vmware config editor set com2 to type "device"
and give it a device of /dev/nmdm0A

then in the gdb config 
follow the instructions for remote debugging but use  the device nmdm0B


when the virtual machine enters the debugger
(ddb) enter the word "gdb" to make it use the gdb stub
then you will need to do a 's' to make it actually switch.

In teh compile directory of the kernel on the main machine:
enter gdb and set remote debugging mode.
(I use the folloing .gdbinit file in the compile directory:)

file kernel.debug
set remotebaud 9600
target remote  /dev/nmdmb1


It's also useful to set a serial console on com1 of the virtual machine so
tha tyou can record and capture
messages.....


I sent a message outlining how to do all this to:
freebsd-emulation@freebsd.org on Fri, 19 Jan 2001 
Message ID: <3A68B649.A52AB05A@elischer.org>
if you want to look at it in the archives.

also

there is a screenshot that probably has some hints on it at
http://www.freebsd.org/~julian/




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" 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.4.21.0109051306490.24154-100000>