public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Something is very wrong with watchpoints
@ 2000-10-12 16:23 Mo DeJong
  2000-10-12 16:37 ` Fernando Nasser
  0 siblings, 1 reply; 2+ messages in thread
From: Mo DeJong @ 2000-10-12 16:23 UTC (permalink / raw)
  To: insight

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

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

* Re: Something is very wrong with watchpoints
  2000-10-12 16:23 Something is very wrong with watchpoints Mo DeJong
@ 2000-10-12 16:37 ` Fernando Nasser
  0 siblings, 0 replies; 2+ messages in thread
From: Fernando Nasser @ 2000-10-12 16:37 UTC (permalink / raw)
  To: Mo DeJong; +Cc: insight

Mo DeJong wrote:
> 
> 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.
> 

I don't think the native target as support for the ardware watchpoint (unless it was
added recently).  What may have happened is that a software watchpoint is being 
implemented with single stepping.  Gdb checks things and continues the target
without the GUI noticing and may not be calling the GUI hook very frequently (I am
surprised it was called at all, as the redraws seem to indicate).

That is why I added watchpoints to the TODO list.  Now you know :-(


> 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

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

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

end of thread, other threads:[~2000-10-12 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-12 16:23 Something is very wrong with watchpoints Mo DeJong
2000-10-12 16:37 ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).