From owner-kgdb@oss.sgi.com Wed May 3 14:55:18 2000 Received: by oss.sgi.com id ; Wed, 3 May 2000 14:55:09 -0700 Received: from deliverator.sgi.com ([204.94.214.10]:14384 "EHLO deliverator.sgi.com") by oss.sgi.com with ESMTP id ; Wed, 3 May 2000 14:54:47 -0700 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id OAA13499 for ; Wed, 3 May 2000 14:49:58 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: from illini.engr.sgi.com (illini.engr.sgi.com [163.154.5.81]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id OAA16604 for <@cthulhu.engr.sgi.com:kgdb@oss.sgi.com>; Wed, 3 May 2000 14:54:26 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: (from sfoehner@localhost) by illini.engr.sgi.com (980427.SGI.8.8.8/980728.SGI.AUTOCF) id OAA01027 for kgdb@oss.sgi.com; Wed, 3 May 2000 14:54:01 -0700 (PDT) Date: Wed, 3 May 2000 14:54:01 -0700 (PDT) From: sfoehner@illini.engr.sgi.com (Scott Foehner) Message-Id: <10005031454.ZM400502@illini.engr.sgi.com> X-Mailer: Z-Mail-SGI (3.2S.3 08feb96 MediaMail) To: kgdb@oss.sgi.com Subject: kgdb_2.2.14-rh62 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing I have put Doug Kilpatrick's updated 2.2 kernel series kgdb patch on oss.sgi.com. It can be downloaded from ftp://oss.sgi.com/www/projects/kgdb/download/ The filename is kgdb_2.2.14-rh62.diff. There is the caveat that I have not tested it yet, but Doug says that he hasn't had any problems using it with a 2.2.14-5 series kernel from RedHat 6.2. The following is a list of changes this patch includes sent out by Doug a few weeks back: Added the ability to attach the debugger from a SysRq key ('g'). Since the key-up's Will happen while the debugger is being attached, this will leave the keyboard in a bit of a messed up state. Press and release SysRq to re-sync things. Integrated some changes from Tigran Aivazian from a similar patch against 2.2.6 that seemed to be missing and needed. This includes a breakpoint() in mm/fault.c, some more debugging information, and some changes to the register information output. It appears putDebugChar() changed signatures somewhere along the line. Fixed. Fixed parcing of the init line to set gdbttyS= and gdbbaud= options. Scott -- Scott Foehner SGI sfoehner@engr.sgi.com Computer Systems Business Unit 650-933-3473 Core OS From owner-kgdb@oss.sgi.com Tue May 9 20:57:16 2000 Received: by oss.sgi.com id ; Tue, 9 May 2000 20:57:06 +0000 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:42064 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Tue, 9 May 2000 20:56:48 +0000 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id OAA06102 for ; Tue, 9 May 2000 14:01:11 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: from illini.engr.sgi.com (illini.engr.sgi.com [163.154.5.81]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id NAA42098; Tue, 9 May 2000 13:56:28 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: (from sfoehner@localhost) by illini.engr.sgi.com (980427.SGI.8.8.8/980728.SGI.AUTOCF) id NAA84138; Tue, 9 May 2000 13:55:46 -0700 (PDT) Date: Tue, 9 May 2000 13:55:46 -0700 (PDT) From: sfoehner@illini.engr.sgi.com (Scott Foehner) Message-Id: <10005091355.ZM403599@illini.engr.sgi.com> In-Reply-To: "Vinodkumar Parasmal" "remote-debugging help" (May 9, 2:19pm) References: <3917D118.B775152C@wipro.com> X-Mailer: Z-Mail-SGI (3.2S.3 08feb96 MediaMail) To: "Vinodkumar Parasmal" Subject: Re: remote-debugging help Cc: kgdb@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing Vinod, I can take a guess at what's going on. Your .gdbinit file should actually define a command to connect to the target machine. Something like: define rmt set remotebaud 38400 target remote /dev/ttyd2 end Once the kernel is up on the target machine, and it says that it is waiting for a connection from gdb, type "rmt" at the gdb command line. This should connect to the target machine. gdb and the target kernel will then essentially be at a breakpoint. Just type "continue" at the gdb prompt, and the machine should continue booting. You can also set breakpoints before continuing if you like. Scott On May 9, 2:19pm, Vinodkumar Parasmal wrote: > Subject: remote-debugging help > Hi , > I am facing a problem in remote debugging of Linux Kernel.(RH 6.1 > 2.2.12.-20) > Let me explain the problem in detail. > > I have made some changes in the Linux Kernel's Tcpip Source > code.(2.2.12-20 RedHat 6.1) > I recompiled the Kernel and i had some problems. > So I want to debug the Kernel from a remote Machine. > For that I downloaded the patch from oss.sgi.com ( kgdb2.2.12-20) > I applied the patch by using the command-- patch -p0 < > /tmp/kgdb2.2.12-20 > After applying the patch I enabled the remote Debug option in xconfig by > > doing > make xconfig. > Next I did "make dep". > For creating a kernel Image I did "make bzImage" > This I did in a development m/c. > I copied the bzImage into a Target M/c to test it. > I added the following lines in the lilo.conf of the target M/c > image=/usr/src/linux/arch/i386/boot/bzImage > label=kdebug > read-only > root=/dev/hda5 > append="gdb gdbttyS=/dev/ttyS0 gdbbaud=38400 > > This new Image was added by issuing the command lilo. > This is on the Target M/c > > On the Development M/c as per the instructions in the oss.sgi.com's help > > I created a file called .gdbinit in /usr/src/linux-2.2.12-20 directory > where vmlinux.resides > > Contents of .gdbinit > set remotebreak 1 > target remote /dev/ttyS0 > > After this on the command line I set the Baudrate to 38400 by > setserial /dev/ttyS0 baud_base 38400 > > I have also checked the serial connection by cu command . > It works fine ie I am able to send and receive data via /dev/ttyS0 > between the Development and target m/cs. > > Target M/c is booted with the new Image. > It says after some time "Waitng for connection from Remote gdb" > > On the Development M/c in /usr/src/linux-2.2.12-20 directory I issued > the command: > gdb vmlinux > > It does nothing.Both are waiting for a long time. > I can't trace where the problem is. > Is that gdb on the development m/c is not sending proper data to the > Target m/c > Or is there any problem on the target M/c. > I am trying this for a long time. > Can u give me info about how to solve this problem. > > Thankx in advance. > -- > Cheers > Vinod > > > >-- End of excerpt from Vinodkumar Parasmal -- Scott Foehner SGI sfoehner@engr.sgi.com Computer Systems Business Unit 650-933-3473 Core OS From owner-kgdb@oss.sgi.com Wed May 10 12:45:31 2000 Received: by oss.sgi.com id ; Wed, 10 May 2000 12:45:21 +0000 Received: from agni.wipinfo.soft.net ([164.164.6.20]:25252 "EHLO agni.wipinfo.soft.net") by oss.sgi.com with ESMTP id ; Wed, 10 May 2000 12:45:05 +0000 Received: from vayu.wipinfo.soft.net (vayu [192.168.200.170]) by agni.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id SAA05837 for ; Wed, 10 May 2000 18:11:58 +0500 (GMT) Received: from canine.wipinfo.soft.net (root@canine.wipinfo.soft.net [192.168.205.6]) by vayu.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id SAA12329 for ; Wed, 10 May 2000 18:13:53 +0500 (GMT) Received: from tagore (ncrtagore.wipinfo.soft.net [192.168.205.3]) by canine.wipinfo.soft.net (8.9.3/8.9.3) with SMTP id UAA20470 for ; Wed, 10 May 2000 20:10:01 +0530 Received: by tagore (sSMTP sendmail emulation); Wed, 10 May 2000 18:34:26 +0530 Date: Wed, 10 May 2000 18:34:26 +0530 From: Raju K V To: kgdb@oss.sgi.com Subject: how to setup a debugging environment Message-ID: <20000510183426.D14378@wipro.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.10i X-PGP-Key: To get my public-key, send mail with subject 'get pgp keys' X-Editor: VIM - Vi IMproved 5.6 (2000 Jan 16, compiled Feb 22 2000 10:07:00) X-Editor-URL: http://www.vim.org Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing hi, I am developing a RAID controller driver and facing some problems. So I am thinking of using kgdb to debug it. But how do I setup the debugging environment? No where is it mentioned how to do it. The RAID card is on an SMP system running linux-2.2.12(target system). The machine having GDB is a small linux PC running 2.2.12(host system). I am listing my options for setting up the debugging environment. 1. I untar the kernel sources on the host system. Add the kgdb patch. Compile it. copy the full source tree to the target system. Install the kernel. start with "linux gdb". But where do I put the .gdbinit on the host system? at /usr/src/linux? 2. I do the kernel compilation on the target system and install the kernel. Then I copy the tree to the host system. Which of the above methods are better? Also if you have any other suggestion, I would like to hear it. Also are there any issue involved in debugging modules thru kgdb? Thanks in advance, Raju From owner-kgdb@oss.sgi.com Wed May 10 13:54:14 2000 Received: by oss.sgi.com id ; Wed, 10 May 2000 20:53:55 +0000 Received: from deliverator.sgi.com ([204.94.214.10]:8478 "EHLO deliverator.sgi.com") by oss.sgi.com with ESMTP id ; Wed, 10 May 2000 20:53:38 +0000 Received: from nodin.corp.sgi.com (nodin.corp.sgi.com [192.26.51.193]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id NAA12869 for ; Wed, 10 May 2000 13:48:49 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by nodin.corp.sgi.com (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id NAA01657 for ; Wed, 10 May 2000 13:51:51 -0700 (PDT) Received: from illini.engr.sgi.com (illini.engr.sgi.com [163.154.5.81]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id NAA01059; Wed, 10 May 2000 13:50:16 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: (from sfoehner@localhost) by illini.engr.sgi.com (980427.SGI.8.8.8/980728.SGI.AUTOCF) id NAA99849; Wed, 10 May 2000 13:49:38 -0700 (PDT) Date: Wed, 10 May 2000 13:49:38 -0700 (PDT) From: sfoehner@illini.engr.sgi.com (Scott Foehner) Message-Id: <10005101349.ZM496054@illini.engr.sgi.com> In-Reply-To: Raju K V "how to setup a debugging environment" (May 10, 6:34pm) References: <20000510183426.D14378@wipro.com> X-Mailer: Z-Mail-SGI (3.2S.3 08feb96 MediaMail) To: Raju K V Subject: Re: how to setup a debugging environment Cc: kgdb@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing It's not necessary to have the source tree on both systems. So, I would recommend compiling on the host system, so that gdb can look at the sources. Just copy the kernel over to the target system (the one you are debugging). .gdbinit is a gdb config file. It should be placed in your home directory. Scott On May 10, 6:34pm, Raju K V wrote: > Subject: how to setup a debugging environment > hi, > > I am developing a RAID controller driver and facing some problems. So I > am thinking of using kgdb to debug it. But how do I setup the debugging > environment? No where is it mentioned how to do it. The RAID card is on > an SMP system running linux-2.2.12(target system). The machine having GDB is a small > linux PC running 2.2.12(host system). > > I am listing my options for setting up the debugging environment. > > 1. I untar the kernel sources on the host system. Add the kgdb patch. > Compile it. copy the full source tree to the target system. Install the > kernel. start with "linux gdb". But where do I put the .gdbinit on the > host system? at /usr/src/linux? > > 2. I do the kernel compilation on the target system and install the > kernel. Then I copy the tree to the host system. > > Which of the above methods are better? Also if you have any other > suggestion, I would like to hear it. > > Also are there any issue involved in debugging modules thru kgdb? > > Thanks in advance, > Raju >-- End of excerpt from Raju K V -- Scott Foehner SGI sfoehner@engr.sgi.com Computer Systems Business Unit 650-933-3473 Core OS From owner-kgdb@oss.sgi.com Wed May 10 19:51:58 2000 Received: by oss.sgi.com id ; Thu, 11 May 2000 02:51:48 +0000 Received: from agni.wipinfo.soft.net ([164.164.6.20]:22719 "EHLO agni.wipinfo.soft.net") by oss.sgi.com with ESMTP id ; Thu, 11 May 2000 02:51:40 +0000 Received: from vayu.wipinfo.soft.net (vayu [192.168.200.170]) by agni.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id IAA14456; Thu, 11 May 2000 08:17:59 +0500 (GMT) Received: from canine.wipinfo.soft.net (root@canine.wipinfo.soft.net [192.168.205.6]) by vayu.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id IAA17540; Thu, 11 May 2000 08:20:00 +0500 (GMT) Received: from tagore (ncrtagore.wipinfo.soft.net [192.168.205.3]) by canine.wipinfo.soft.net (8.9.3/8.9.3) with SMTP id KAA23304; Thu, 11 May 2000 10:16:11 +0530 Received: by tagore (sSMTP sendmail emulation); Thu, 11 May 2000 08:40:35 +0530 Date: Thu, 11 May 2000 08:40:35 +0530 From: Raju K V To: Scott Foehner Cc: kgdb@oss.sgi.com Subject: Re: how to setup a debugging environment Message-ID: <20000511084035.I14378@wipro.com> References: <20000510183426.D14378@wipro.com> <10005101349.ZM496054@illini.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.10i In-Reply-To: <10005101349.ZM496054@illini.engr.sgi.com>; from sfoehner@illini.engr.sgi.com on Wed, May 10, 2000 at 01:49:38PM -0700 X-PGP-Key: To get my public-key, send mail with subject 'get pgp keys' X-Editor: VIM - Vi IMproved 5.6 (2000 Jan 16, compiled Feb 22 2000 10:07:00) X-Editor-URL: http://www.vim.org Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing hi, Thanks for your reply. Are there any issues that I should take care while debugging modules with kgdb? Thanks in advance, Raju On Wed, May 10, 2000 at 01:49:38PM -0700, Scott Foehner [sfoehner@illini.engr.sgi.com] wrote: > It's not necessary to have the source tree on both systems. So, I would > recommend compiling on the host system, so that gdb can look at the sources. > Just copy the kernel over to the target system (the one you are debugging). > > .gdbinit is a gdb config file. It should be placed in your home directory. > > Scott > From owner-kgdb@oss.sgi.com Thu May 11 00:48:12 2000 Received: by oss.sgi.com id ; Thu, 11 May 2000 07:48:03 +0000 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:24668 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Thu, 11 May 2000 07:47:40 +0000 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id AAA00749 for ; Thu, 11 May 2000 00:52:04 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: from illini.engr.sgi.com (illini.engr.sgi.com [163.154.5.81]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id AAA50773; Thu, 11 May 2000 00:47:20 -0700 (PDT) mail_from (sfoehner@illini.engr.sgi.com) Received: (from sfoehner@localhost) by illini.engr.sgi.com (980427.SGI.8.8.8/980728.SGI.AUTOCF) id AAA95924; Thu, 11 May 2000 00:46:39 -0700 (PDT) Date: Thu, 11 May 2000 00:46:39 -0700 (PDT) From: sfoehner@illini.engr.sgi.com (Scott Foehner) Message-Id: <10005110046.ZM505349@illini.engr.sgi.com> In-Reply-To: Raju K V "Re: how to setup a debugging environment" (May 11, 8:40am) References: <20000510183426.D14378@wipro.com> <10005101349.ZM496054@illini.engr.sgi.com> <20000511084035.I14378@wipro.com> X-Mailer: Z-Mail-SGI (3.2S.3 08feb96 MediaMail) To: Raju K V Subject: Re: how to setup a debugging environment Cc: kgdb@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing On May 11, 8:40am, Raju K V wrote: > Are there any issues that I should take care while debugging modules > with kgdb? Sorry, I forgot to reply to the modules part of your question in the previous email. I don't believe debugging modules with the 2.2.x series of kgdb is possible. It is possible to do it with the 2.3.x kernel series. However, to get full functionality with modules you must have a slightly modified gdb. There is some discussion of this in the mail archives on oss.sgi.com/projects/kgdb Scott -- Scott Foehner SGI sfoehner@engr.sgi.com Computer Systems Business Unit 650-933-3473 Core OS From owner-kgdb@oss.sgi.com Thu May 11 07:38:05 2000 Received: by oss.sgi.com id ; Thu, 11 May 2000 14:37:46 +0000 Received: from sentry.gw.tislabs.com ([192.94.214.100]:54780 "EHLO sentry.gw.tislabs.com") by oss.sgi.com with ESMTP id ; Thu, 11 May 2000 14:37:24 +0000 Received: by sentry.gw.tislabs.com; id KAA07360; Thu, 11 May 2000 10:39:13 -0400 (EDT) Received: from clipper.gw.tislabs.com(10.33.1.2) by sentry.gw.tislabs.com via smap (V5.5) id xma007353; Thu, 11 May 00 10:39:06 -0400 Received: from dustpuppy.va.tislabs.com (IDENT:root@dustpuppy.va.tislabs.com [192.168.10.114]) by clipper.gw.tislabs.com (8.9.3/8.9.1) with ESMTP id KAA03832 for ; Thu, 11 May 2000 10:32:04 -0400 (EDT) Received: from localhost (dougk@localhost) by dustpuppy.va.tislabs.com (8.9.3/8.8.7) with ESMTP id KAA26198 for ; Thu, 11 May 2000 10:35:17 -0400 X-Authentication-Warning: dustpuppy.va.tislabs.com: dougk owned process doing -bs Date: Thu, 11 May 2000 10:35:17 -0400 (EDT) From: Douglas Kilpatrick X-Sender: dougk@dustpuppy.va.tislabs.com To: kgdb@oss.sgi.com Subject: Re: how to setup a debugging environment In-Reply-To: <10005110046.ZM505349@illini.engr.sgi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-kgdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kgdb-outgoing On Thu, 11 May 2000, Scott Foehner wrote: > Sorry, I forgot to reply to the modules part of your question in the previous > email. I don't believe debugging modules with the 2.2.x series of kgdb is > possible. It is possible to do it with the 2.3.x kernel series. However, to Its quite possible, as long as you don't need to look at global variables. Load the module with "insmod foo.o | grep text", and in gdb "add-symbol-file foo.o 0x" For debugging purposes, load the globals into locals. Obviously this plays hell on SMP, but its not like SMP is debuggable anyway. :) Doug -- dougk@tislabs.com dkilpatr@nai.com