From owner-freebsd-hackers Thu Sep 24 16:16:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA09161 for freebsd-hackers-outgoing; Thu, 24 Sep 1998 16:16:59 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA09156 for ; Thu, 24 Sep 1998 16:16:55 -0700 (PDT) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40331>; Fri, 25 Sep 1998 09:16:19 +1000 Date: Fri, 25 Sep 1998 09:16:36 +1000 From: Peter Jeremy Subject: Re: Idea for a small project... To: hackers@FreeBSD.ORG Message-Id: <98Sep25.091619est.40331@border.alcanet.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 23 Sep 1998 21:20:24 -0400 (EDT), Thomas David Rivers wrote: > The Pentium chip has improved support for debugging programs, including > a hardware assisted databreak manager. Note that this feature pre-dates the Pentium. I think it was introduced with the 386, it's definitely part of the 486. > A nice improvement to FreeBSD would be to improve the ptrace() support > so that it used the hardware assisted feature when running on a Pentium. And to modify GDB so it supports them. This latter task shouldn't be too difficult since GDB already supports i386 hardware watchpoints on both Linux and SCO. > The feature is limited in the number of breakpoints you can manage; > extra credit would be to not expose this limitation. This doesn't belong in the kernel. ptrace(2) should just make the existing debug registers visible to a debugger (this is what GDB expects). I'm not sure if GDB transparently handles switching between hardware and software watchpoints. > Use the hardware > break point feature for the first N watch points (I believe N would > be 4 in this case) I believe you can have a total of 4 hardware watch/breakpoints, but I don't think that a single hardware watchpoint is sufficiently general to allow watching an arbitrary C variable (ie watching one variable may need more than one hardware watchpoint slot). Note that implementing this will require the debug registers to be saved on a task switch, which means struct user will change, so it's not totally trivial. Peter -- Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message