This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB library to insert and delete watchpoints
- From: Stan Shebs <stan at codesourcery dot com>
- To: Aravinda <aravindakidambi at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 04 Dec 2009 00:51:30 -0800
- Subject: Re: GDB library to insert and delete watchpoints
- References: <26eb53620911301516x68ccc0edkf64ba2951c8ce3a3@mail.gmail.com> <26eb53620911301518y13e64bc0g95c6fe3c7b18b0c@mail.gmail.com>
Aravinda wrote:
Hi,
Im working on a project that currently requires inserting and deleting
watchpoints to monitor buffer overruns. I was looking at the
gdb-internals documentation which talks about a gdb library that can
be used to do exactly this. But I couldnt find more info on this. Im
looking for a ready to use library to be used with a kernel module
that allows for modifying the debug registers. kindly point me to any
sources if it can be done.
It just so happens that CodeSourcery recently did this for a customer
that was using a debugging stub that ran as one of several threads in
the application. It does need its own driver to modify the debug
registers, and the stub calls it once it has done the bit-twiddling on
mirrors of the registers. While it works well enough to have one thread
set the debug registers of a different thread in a Linux app, there is
some fancy dancing to make this work in nonstop - with all the threads
running at once, you can get nasty races all over the place.
Unfortunately, this is all CodeSourcery proprietary code and
intermingled with the customer's app to boot, so I can't send you a copy.
Stan