This commit fixes issue #264.
It is expected, if the program running under debuggers control, call to
System.Diagnostics.Debugger.Break() should stop the program (as if the
breakpoint is set).
int(event.threadId), frameLocation.c_str());
break;
}
+ case StopBreak:
+ {
+ printf("\nstopped, reason: Debugger.Break, thread id: %i, stopped threads: all, frame={%s\n}\n",
+ int(event.threadId), frameLocation.c_str());
+ break;
+ }
default:
return;
}
/* [in] */ ICorDebugThread *thread)
{
LogFuncEntry();
- return E_NOTIMPL;
+ ThreadId threadId(getThreadId(thread));
+
+ m_debugger.SetLastStoppedThread(thread);
+
+ StoppedEvent event(StopBreak, threadId);
+
+ ToRelease<ICorDebugFrame> pFrame;
+ if (SUCCEEDED(thread->GetActiveFrame(&pFrame)) && pFrame != nullptr)
+ {
+ StackFrame stackFrame;
+ if (m_debugger.GetFrameLocation(pFrame, threadId, FrameLevel{0}, stackFrame) == S_OK)
+ event.frame = stackFrame;
+ }
+
+ m_debugger.m_protocol->EmitStoppedEvent(event);
+ return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE Exception(
int(event.threadId), frameLocation.c_str());
break;
}
+ case StopBreak:
+ {
+ MIProtocol::Printf("*stopped,reason=\"Debugger.Break\",thread-id=\"%i\",stopped-threads=\"all\",frame={%s}\n",
+ int(event.threadId), frameLocation.c_str());
+ break;
+ }
default:
return;
}
StopBreakpoint,
StopException,
StopPause,
- StopEntry
+ StopEntry,
+ StopBreak
};
struct StoppedEvent
case StopEntry:
body["reason"] = "entry";
break;
+ case StopBreak:
+ body["reason"] = "Debugger.Break";
+ break;
}
body["description"] = event.description;