List Info

Thread: watchpoints and threads




watchpoints and threads
user name
2006-04-26 18:03:02
The manual states:

     _Warning:_ In multi-thread programs, watchpoints have
only limited
     usefulness.  With the current watchpoint
implementation, GDB can
     only watch the value of an expression _in a single
thread_.  If
     you are confident that the expression can only change
due to the
     current thread's activity (and if you are also
confident that no
     other thread can become current), then you can use
watchpoints as
     usual.  However, GDB may not notice when a non-current
thread's
     activity changes the expression.

Yet the test testsuite/gdb.threads/watchthreads.exp contains
the
following:

        # Verify that we hit first watchpoint in child
thread.
        set message "watchpoint on args\[0\] hit in
thread"
        if { $args_1 > 1 } {
          pass $message
        } else {
          fail $message
        }
        
This seems like a conflict.

What brought this up is a user who wants this scenario to
work:

        * The target program has a global variable.
        * GDB is started and a 'watch' command is give for
that
        variable.
        * Some number of threads are started.
        * If _any_ thread changes the value of the global
variable,
        _all_ threads stop.
        
The manual seems to say that this scenario will not work,
but the
testcase seems to say that it will.

What's the story?

-=# Paul #=-

watchpoints and threads
user name
2006-04-26 18:17:29
On Wed, Apr 26, 2006 at 11:03:02AM -0700, PAUL GILLIAM
wrote:
> The manual seems to say that this scenario will not
work, but the
> testcase seems to say that it will.
> 
> What's the story?

The patches to implement this (for some limited set of
architectures?)
were approved but never committed, I believe.  Like last
January.

-- 
Daniel Jacobowitz
CodeSourcery
watchpoints and threads
user name
2006-05-21 13:28:28
Hi Daniel,

On Wed, 26 Apr 2006, Daniel Jacobowitz wrote:

> On Wed, Apr 26, 2006 at 11:03:02AM -0700, PAUL GILLIAM
wrote:
> > The manual seems to say that this scenario will
not work, but the
> > testcase seems to say that it will.
> > 
> > What's the story?
> 
> The patches to implement this (for some limited set of
architectures?)
> were approved but never committed, I believe.  Like
last January.

I guess this thread initiated by Jeff Johnston is what you
were referring to:
http://sources.redhat.com/ml/gdb-patches/2004-12/m
sg00256.html

It was really a long thread, spanning several monthes.  My
reading of 
these post tell me that it is partly approved at some point,
and later 
held off for observer issue.  Is that right?  Does that kind
of issue 
still hold in current gdb source code?  Does anybody has
interest in 
looking into these question again?

I am recently working on h/w watchpoint support for ppc440
board.  
Customers are also inquirying if multi-threaded program
works ok with 
h/w watchpoint.  I believe this feature is quite desirable
for multi
threaded program.

Regards
- Wu Zhou
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )