Problem with manual watchpoints

Tue Dec 29 03:00:00 GMT 2009


Thanks a lot. I tried the ptrace testsuite and found nothing was wrong
with the VM; all tests ran fine.

But, i figured the problem was, I was doing an ioctl to access the
kernel module which runs in the same process context and so, sometimes
the assigning

task_struct->thread_struct->debugreg[0] = addr

was actually not committed to the address to the hardware debug
register. I forced a move to debug register by calling
processor.h/set_debugreg(val, regno). It consistently raises the
SIGTRAP now. Looking at ptrace code in the linux, they dont have to do
it since its from a different process the DR values are modified so
when the child process is scheduled back,  the modified DR values are
copied into the hardware debug registers.


On Mon, Dec 28, 2009 at 4:48 PM, Jan Kratochvil
<> wrote:
> On Mon, 28 Dec 2009 22:21:34 +0100, Aravinda wrote:
>> Could it be possible for a processor with debug registers to not support
>> exact reporting or could there be problems since Im working on a VM ?
> Which "VM"?  It is true some old KVMs had some bugs with watchpoints.  Those
> are fixed long time (such as at least in kernel-
> You can run the gdb testsuite both in host and in guest OS and compare it.
> You can also compare the results from:
> Regards,
> Jan

More information about the Gdb mailing list