File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
lldb/source/Plugins/Process/Windows/Common Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,26 @@ void DebuggerThread::DebugLoop() {
307307 LLDB_LOG (log,
308308 " Breakpoint exception is cue to detach from process {0:x}" ,
309309 m_pid_to_detach.load ());
310+
311+ // detaching with leaving breakpoint exception event on the queue may
312+ // cause target process to crash so process events as possible since
313+ // target threads are running at this time, there is possibility to
314+ // have some breakpoint exception between last WaitForDebugEvent and
315+ // DebugActiveProcessStop but ignore for now.
316+ while (WaitForDebugEvent (&dbe, 0 )) {
317+ continue_status = DBG_CONTINUE;
318+ if (dbe.dwDebugEventCode == EXCEPTION_DEBUG_EVENT &&
319+ !(dbe.u .Exception .ExceptionRecord .ExceptionCode ==
320+ EXCEPTION_BREAKPOINT ||
321+ dbe.u .Exception .ExceptionRecord .ExceptionCode ==
322+ STATUS_WX86_BREAKPOINT ||
323+ dbe.u .Exception .ExceptionRecord .ExceptionCode ==
324+ EXCEPTION_SINGLE_STEP))
325+ continue_status = DBG_EXCEPTION_NOT_HANDLED;
326+ ::ContinueDebugEvent (dbe.dwProcessId, dbe.dwThreadId,
327+ continue_status);
328+ }
329+
310330 ::DebugActiveProcessStop (m_pid_to_detach);
311331 m_detached = true ;
312332 }
You can’t perform that action at this time.
0 commit comments