Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Problem with manual watchpoints
@ 2009-12-24 20:47 Aravinda
  2009-12-24 21:08 ` Jan Kratochvil
  0 siblings, 1 reply; 7+ messages in thread
From: Aravinda @ 2009-12-24 20:47 UTC (permalink / raw)
  To: gdb

Hi,

Im facing a very wierd problem. Its nothing to do with GDB, but i was
just wondering if theres something about 'hardware watchpoints' im
missing here.

I have a kernel module that can add watchpoints for a process. The
module can be invoked by __add_watchpoint(pid, address).
I wrote the program below to test the module. In the below program, I
have allocated a buffer 'a' and access 'a[0], a[1] .... a[25]'. I have
the address of a[20] loaded in one of the debug register.

a = malloc(20);
__add_watchpoint(getpid(), &a[20]);

for (i = 0; i < 25; i ++) {
	/* getc(stdin); ----> without this, no SIGTRAP is getting generated */
	printf("Accessing now %x\n", &a[i]);
	a[i]++;
}

While I expect the program to be interrupted by a tracepoint exception
on accessing a[20], it actually does not. It runs to completion
without catching any trap exception. However, if I just add a
'getc(stdin)' before accessing every element, it does get the
exception on accessing a[20].

Does anyone know what could be going on ?

Thanks,
Aravinda


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-12-29  3:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24 20:47 Problem with manual watchpoints Aravinda
2009-12-24 21:08 ` Jan Kratochvil
2009-12-24 21:42   ` Aravinda
2009-12-24 21:52     ` Jan Kratochvil
2009-12-28 21:22       ` Aravinda
2009-12-28 21:49         ` Jan Kratochvil
2009-12-29  3:00           ` Aravinda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox