Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 1998 09:16:36 +1000
From:      Peter Jeremy <peter.jeremy@auss2.alcatel.com.au>
To:        hackers@FreeBSD.ORG
Subject:   Re: Idea for a small project...
Message-ID:  <98Sep25.091619est.40331@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help
On Wed, 23 Sep 1998 21:20:24 -0400 (EDT), Thomas David Rivers <rivers@dignus.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98Sep25.091619est.40331>