Re: Problem with manual watchpoints

Aravinda
2009-12-29T03:00:30Z

Hi,

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.

Thanks,
Aravinda

On Mon, Dec 28, 2009 at 4:48 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> 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-2.6.31.9-174.fc12.x86_64).
> You can run the gdb testsuite both in host and in guest OS and compare it.
> You can also compare the results from:
>        http://sourceware.org/systemtap/wiki/utrace/tests
>
>
> Regards,
> Jan
>