From owner-freebsd-hackers Thu Apr 20 7:28:40 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id E4DF237BDEA for ; Thu, 20 Apr 2000 07:28:36 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (sol.cs.binghamton.edu [128.226.123.100]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with ESMTP id KAA21730; Thu, 20 Apr 2000 10:28:34 -0400 (EDT) Date: Thu, 20 Apr 2000 10:28:31 -0400 (EDT) From: Zhihui Zhang To: "NandaKumar P.K." Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Remote kernel debugging In-Reply-To: <20000420084459.11675.qmail@web1901.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have looked over your steps. It seems that the steps are all correct. I can suggest four things: (1) Consider using "makeoptions DEBUG=-g" in your configure file. (2) If you are using FreeBSD 3.3-Release, the flag may be 0x50 instead of 0x80. (3) Lower the baud rate if possible. However, the default 9600 should be OK. (4) Type step in the target machine before running gdb at the debugging machine. Good Luck, -Zhihui On Thu, 20 Apr 2000, NandaKumar P.K. wrote: > Hi, > > We were trying to debug the SCSI CAM driver using > remote gdb, but we were not able to establish the > connection between the target machine and host > machine. > > The host and the target machine were connected using a > null modem cable which was tested using Pcplus utility > in DOS. In both the machines the cable is connected to > the COM1 port. > > The steps which we followed were as follows. > In the host machine > 1. Made a copy of the GENERIC kernel called MYKERNEL. > 2. The follwing additions were made to MYKERNEL > options DDB > device sio0 at isa? port "IO_COM1" flags 0x080 > 3. Compiled using config -g and installed MYKERNEL . > 4. Made a copy of the kernel , kernel.debug > 5. Copied the kernel.debug to the target machine. > > In the target machine > 1. Strip -x kernel.debug & then reboot. > 2. At the boot prompt ,loaded kernel.debug > 3. Opened the debugger using boot -d > > In the host machine > 1. cd /usr/src/sys/compile/MYKERNEL > 2. gdb -k kernel > 3. (kgdb) target remote /dev/cuaa0 > > In the target > 1.db>gdb > 2. s > > Now the following error message was displayed in the > host > Ignoring packet error,continuing.. > Ignoring packet error,continuing.. > Ignoring packet error,continuing.. > Could'nt establish connection to remote target > Malformed response to offset query,timeout > > Using the same cable i was able to set the serial > console on the machine and were able to find the > printf messages coming on the other machine. I also > found some characters sent by the host machine when > the target > remote /dev/cuaa0 command is given. I had the terminal > emulation package pcplus on the other machine. But i > couldn't find any character sent by the target machine > when 's' is pressed there. So i have a doubt regarding > my target machine's setting is not O.K. But i am not > able to find the problem there. Any help will be > deeply appreciated. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message