views:

180

answers:

2

When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with:

0x(some hex ref) : tdb_event_death      : ret
dbx: thread has exited -- next aborted

My guess is a thread somewhere in the program I am debugging has stopped, but it's not the one I'm debugging so I can't see why I have to restart the debugging process to continue.

I have a work around, I set a breakpoint on the next line then rerun, which works but is very annoying, it is really slowing down my debugging. Does anyone know a better way ? (single step ALL threads for example)

+1  A: 

Hi, try setting you environment variable _THREAD_ERROR_DETECTION to 0

some light reading

Ric Tokyo
This does work. I would accept it, but its too late... (sorry)
Chris Huang-Leaver
actually, setting it to '1' worked :-)
Chris Huang-Leaver
+1  A: 

What is likely happening is that some other thread has exited (doing next resumes all threads in the process, not just the one you are debugging). You can verify this: do thread when you start debugging a particular place, and again when you get the next aborted message.

If the thread you are debugging doesn't need to interact with other threads, you can resume just that one thread with next <thread_id> (where thread_id is the one thread command prints).

A word of caution: if your thread needs to malloc() some memory, you may have to resume other threads, because one of them could be holding e.g. malloc lock.

Employed Russian