This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Something is very wrong with watchpoints


I tried to set a hardware watchpoint in insight, it worked but when
I ran the program the GUI stopped responding. It would redraw itself
about once every 5 minutes. Has anyone else run into this?
I am using Linux (Red Hat 6.2) on x86.

Here is a trivial little example that shows how to reproduce
the problem. Just compile this with:

% gcc -g -o watch watch.c

And type the gdb command into the console, note how the GUI
does not redraw after you type continue.

#include <unistd.h>

int main() {
   int i,j;
   for (i=0, j=0; i < 100000000 ; i++) {
     if (i%1000 == 0)
       j++;
   }
}

/*
start the program and set a breakpoint on the for loop line

(gdb) break 5 
(gdb) run

now set a watchpoint at the address of the j variable

(gdb) print &j
(gdb) watch (the hex addr that was just printed)
(gdb) cont

*/

thanks
Mo DeJong
Red Hat Inc

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]