From owner-freebsd-doc@FreeBSD.ORG Wed Nov 1 19:48:16 2006 Return-Path: X-Original-To: docs@freebsd.org Delivered-To: freebsd-doc@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3407916A618 for ; Wed, 1 Nov 2006 19:48:16 +0000 (UTC) (envelope-from prvs=julian=453a8fdc9@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD28443D53 for ; Wed, 1 Nov 2006 19:48:15 +0000 (GMT) (envelope-from prvs=julian=453a8fdc9@elischer.org) Received: from unknown (HELO [192.168.2.4]) ([10.251.60.34]) by a50.ironport.com with ESMTP; 01 Nov 2006 11:48:06 -0800 Message-ID: <4548F9F6.7030905@elischer.org> Date: Wed, 01 Nov 2006 11:48:06 -0800 From: Julian Elischer User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Marcel Moolenaar References: <4548EB40.1060004@elischer.org> <3A3B0453-B3F9-40E4-9FB9-5F27306FE760@mac.com> In-Reply-To: <3A3B0453-B3F9-40E4-9FB9-5F27306FE760@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: docs@freebsd.org Subject: Re: marcel, DDB/GDB/KDB? X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2006 19:48:16 -0000 Marcel Moolenaar wrote: > > On Nov 1, 2006, at 10:45 AM, Julian Elischer wrote: > >> marcel, jhb suggested I ask you the correct way to revert to >> ddb once entering gdb? > > There's no correct way as far as I know. We (the collective) haven't > come up with anything yet. It should be easy enough to add a command > to kgdb that switches the KDB backend, by updating kernel memory. A > more generic approach would be to have kgdb set a function pointer of > a function that is to be called before the kernel resumes. This could > be a function that switches the KDB backend or something else. > >> also, what is the reason for kgdb? > > I created kgdb to avoid having a lot of gdb patches, which would make > future imports of GDB hard. By using a binary that links against libgdb, > it's possible to customize and implement support for kernel debugging > without having to put that knowledge into the core GDB code. > > For example, with kgdb it's easy to debug a crashed kernel. You only > have to specify the vmcore file number with the -n option and kgdb > will find the corresponding kernel. You cannot have this level of > user-friendliness without major patches if you don't have a binary. > > The thread debugging support that David Xu implemented is a perfect > example of why we should not patch GDB: We cannot upgrade GDB at the > moment without also breaking thread debugging. As such, we're in the > same corner we were in before I upgraded GDB... this should be in the docs somewhere.. :-) BTW I like to run xgdb when debugging the kernel as a front-end to gdb but it needs to be fixed to handle kgdb whenever I try it :-) rarely look at crashdumps. I usually end up using live remote debugging. This seems a bit 'delicate' at the moment. > > FYI, >