本文整理汇总了C++中ThreadContext::GetDebugManager方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadContext::GetDebugManager方法的具体用法?C++ ThreadContext::GetDebugManager怎么用?C++ ThreadContext::GetDebugManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadContext
的用法示例。
在下文中一共展示了ThreadContext::GetDebugManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JsDiagStartDebugging
CHAKRA_API JsDiagStartDebugging(
_In_ JsRuntimeHandle runtimeHandle,
_In_ JsDiagDebugEventCallback debugEventCallback,
_In_opt_ void* callbackState)
{
#ifndef ENABLE_SCRIPT_DEBUGGING
return JsErrorCategoryUsage;
#else
return GlobalAPIWrapper_NoRecord([&]() -> JsErrorCode {
VALIDATE_INCOMING_RUNTIME_HANDLE(runtimeHandle);
PARAM_NOT_NULL(debugEventCallback);
JsrtRuntime * runtime = JsrtRuntime::FromHandle(runtimeHandle);
ThreadContext * threadContext = runtime->GetThreadContext();
VALIDATE_RUNTIME_STATE_FOR_START_STOP_DEBUGGING(threadContext);
if (runtime->GetJsrtDebugManager() != nullptr && runtime->GetJsrtDebugManager()->IsDebugEventCallbackSet())
{
return JsErrorDiagAlreadyInDebugMode;
}
// Create the debug object to save callback function and data
runtime->EnsureJsrtDebugManager();
JsrtDebugManager* jsrtDebugManager = runtime->GetJsrtDebugManager();
jsrtDebugManager->SetDebugEventCallback(debugEventCallback, callbackState);
if (threadContext->GetDebugManager() != nullptr)
{
threadContext->GetDebugManager()->SetLocalsDisplayFlags(Js::DebugManager::LocalsDisplayFlags::LocalsDisplayFlags_NoGroupMethods);
}
for (Js::ScriptContext *scriptContext = runtime->GetThreadContext()->GetScriptContextList();
scriptContext != nullptr && !scriptContext->IsClosed();
scriptContext = scriptContext->next)
{
Assert(!scriptContext->IsScriptContextInDebugMode());
Js::DebugContext* debugContext = scriptContext->GetDebugContext();
if (debugContext->GetHostDebugContext() == nullptr)
{
debugContext->SetHostDebugContext(jsrtDebugManager);
}
HRESULT hr;
if (FAILED(hr = scriptContext->OnDebuggerAttached()))
{
Debugger_AttachDetach_fatal_error(hr); // Inconsistent state, we can't continue from here
return JsErrorFatal;
}
// ScriptContext might get closed in OnDebuggerAttached
if (!scriptContext->IsClosed())
{
Js::ProbeContainer* probeContainer = debugContext->GetProbeContainer();
probeContainer->InitializeInlineBreakEngine(jsrtDebugManager);
probeContainer->InitializeDebuggerScriptOptionCallback(jsrtDebugManager);
}
}
return JsNoError;
});
#endif
}