void ExtensionContext::notifyIdleCommand(CIDebugClient *client) { discardSymbolGroup(); if (m_stateNotification) { // Format full thread and stack info along with completed stop reasons. std::string errorMessage; ExtensionCommandContext exc(client); const StopReasonMap stopReasons = completeStopReasons(client, m_stopReason, executionStatus()); // Format std::ostringstream str; formatGdbmiHash(str, stopReasons, false); const std::string threadInfo = gdbmiThreadList(exc.systemObjects(), exc.symbols(), exc.control(), exc.advanced(), &errorMessage); if (threadInfo.empty()) { str << ",threaderror=" << gdbmiStringFormat(errorMessage); } else { str << ",threads=" << threadInfo; } const std::string stackInfo = gdbmiStack(exc.control(), exc.symbols(), maxStackFrames, false, &errorMessage); if (stackInfo.empty()) { str << ",stackerror=" << gdbmiStringFormat(errorMessage); } else { str << ",stack=" << stackInfo; } str << '}'; reportLong('E', 0, "session_idle", str.str()); } m_stopReason.clear(); }
STDMETHODIMP EventCallback::Exception( THIS_ __in PEXCEPTION_RECORD64 Ex, __in ULONG FirstChance ) { // Report the exception as GBMI and set potential stop reason const ExtensionContext::StopReasonMap parameters = exceptionParameters(*Ex, FirstChance); std::ostringstream str; formatGdbmiHash(str, parameters); ExtensionContext::instance().setStopReason(parameters, "exception"); ExtensionContext::instance().report('E', 0, 0, "exception", "%s", str.str().c_str()); return m_wrapped ? m_wrapped->Exception(Ex, FirstChance) : S_OK; }