From owner-freebsd-current@FreeBSD.ORG Thu Feb 17 08:35:29 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F3E916A4CE; Thu, 17 Feb 2005 08:35:29 +0000 (GMT) Received: from gatekeeper.syskonnect.de (gatekeeper.syskonnect.de [213.144.13.149]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBB1E43D53; Thu, 17 Feb 2005 08:35:28 +0000 (GMT) (envelope-from gheinig@syskonnect.de) Received: from syskonnect.de (skd.de [10.9.15.1])j1H8Zi91026884; Thu, 17 Feb 2005 09:35:44 +0100 (MET) Received: from syskonnect.de (localhost [127.0.0.1]) by syskonnect.de (8.12.11/8.12.11) with ESMTP id j1H8ZRO8026585; Thu, 17 Feb 2005 09:35:27 +0100 (MET) Message-ID: <42145726.3020701@syskonnect.de> Date: Thu, 17 Feb 2005 09:34:46 +0100 From: Gerald Heinig User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Greg 'groggy' Lehey" References: <420C76C3.202@syskonnect.de> <20050217000129.GD69640@wantadilla.lemis.com> In-Reply-To: <20050217000129.GD69640@wantadilla.lemis.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@FreeBSD.org Subject: Re: gdb over Firewire X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2005 08:35:29 -0000 Greg 'groggy' Lehey wrote: > On Friday, 11 February 2005 at 10:11:31 +0100, Gerald Heinig wrote: > >>Hello Current'ers, >> >>I'm trying to get two-machine kernel debugging over Firewire working, >>unfortunately without much luck so far. dconschat over Firewire works >>fine, but gdb won't attach, complaining about get_tty_state failed, >>among other things. >>Is kernel gdb over Firewire a -current-only feature? > > > Sorry for the slow reply; I've been busy. > > No, it's not a current-only feature. It used to work, but I've had a > lot of difficulty since the introduction of the new gdb framework. [sorry about the off-topic post to -current] Hi Greg, thanks for the reply. I've actually got it to work now. I compiled dcons and dcons_crom into the kernel and upgraded to 5.3-STABLE on the debugging machine. In addition to this, there was something wrong with my target machine setup. I must have messed up the boot flags a while ago and forgotten about it, because the kernel kept waiting for remote gdb attach before it had probed the Firewire driver, which of course didn't work. Reinstalling a fresh 5.3-RELEASE on the target solved that problem. The kgdb on 5.3-RELEASE doesn't support the IP forwarding functionality for remote devices; that's what the upgrade to -STABLE fixed. So, 'standard' two-machine debugging works for me now. However, what I'm _really_ interested in is the alternative non-cooperative Firewire debugging scheme you describe in your BSDCon paper. Mine almost works, in that I can start up kgdb over /dev/fwmem0.0 However, there's no stack. What I get is: # kgdb -c /dev/fwmem0.0 kernel.debug [gdb copyright stuff] 0x00000000 in ?? () (kgdb) Any ideas as to what I'm doing wrong? Cheers, Gerald > > Try this: > > $ sysctl debug.kdb > debug.kdb.available: ddb > debug.kdb.current: ddb > debug.kdb.enter: 0 > debug.kdb.stop_cpus: 1 > > That's what I get, and it indicates that I don't have gdb capability. > If that's what you get, try building a kernel with firewire support > built-in (as opposed to the (recommended) method of loading the > firewire klds later). The background here is the hypothesis that the > kernel checks for debug back-ends at boot time, and not later, so if > you load the firewire klds later, it won't be registered. > > Note that this is a hypothesis. If you try this, please let us know > what happens. > > Greg > -- > See complete headers for address and phone numbers.