This is the mail archive of the gdb@sourceware.org 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]

Two threads hitting the same break


Gentlepeople,

I'm running into a problem in trying to add threads support for NetBSD
to GDB.

The situation is a breakpoint set in a function that is called by
multiple threads.  One thread hits the break.  It gets the signal, the
process stops, GDB gets control, and sees what it expects.

I then tell GDB to continue.  It does a stepi, reinserts the break, and
lets the process go.  But the other thread has also hit the same
breakpoint.  That signal is delivered at the time I do the continue --
so at that point the break instruction isn't present.  The result is
that GDB sees this as a SIGTRAP at break address + 1 (this is on i386),
and when I continue I get a segfault because the thread is continued in
the middle of an instruction.

I think I've seen discussion of this sort of issue, possibly in the
code, but I'm not having much luck finding it.  Any suggestions for the
right way to handle this?

	paul


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