From owner-freebsd-hackers Wed Sep 5 13: 8: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id D420437B409 for ; Wed, 5 Sep 2001 13:08:04 -0700 (PDT) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA25001; Wed, 5 Sep 2001 13:37:08 -0700 (PDT) Date: Wed, 5 Sep 2001 13:37:06 -0700 (PDT) From: Julian Elischer To: Zhihui Zhang Cc: freebsd-hackers@freebsd.org Subject: Re: kernel ddb/gdb help In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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