This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC]: x86 threaded watchpoint support [2/3]


On Tue, Jun 15, 2004 at 07:19:17AM +0200, Eli Zaretskii wrote:
> > Date: Mon, 14 Jun 2004 17:40:20 -0400
> > From: Jeff Johnston <jjohnstn@redhat.com>
> > 
> > The change is needed because with the threading model, you can have multiple 
> > events to process.  So, if you check your watchpoint values, all of them may 
> > have changed but you end up reporting an invalid thread location.  For example, 
> > I was getting watchpoints changing at the same time of a new thread event (it 
> > couldn't discern).  The reported location was __nptl_create_event (not very 
> > useful).
> 
> Does this mean that when a watchpoint breaks, it stops only the thread
> that hit the watchpoint, while other threads continue to run?
> 
> If all threads stop, then there could not be multiple events, unless
> we are talking about a machine with more than one CPU.
> 
> Or am I missing something?

It's the same problem we already have, just more likely to trigger. 
The kernel does not stop threads for us; we do it ourselves after we
see the first thread trap.  Even if the kernel did it, there would be a
substantial window for other threads to run.

So any time that we see an event from one thread, there can be an
arbitrary set of events from other threads.  In a heavily threaded
application, having extra events at the thread creation breakpoint is
typical.

-- 
Daniel Jacobowitz


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