MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / installDebugAgent

Function installDebugAgent

src/runtime/context.cpp:879–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877 }
878
879 void installDebugAgent ( DebugAgentPtr newAgent, const char * category, LineInfoArg * at, Context * context ) {
880 if ( !category ) context->throw_error_at(at, "need to specify category");
881 std::lock_guard<std::recursive_mutex> guard(g_DebugAgentMutex);
882 auto it = g_DebugAgents.find(category);
883 if ( it != g_DebugAgents.end() ) {
884 DebugAgent * oldAgentPtr = it->second.debugAgent.get();
885 for_each_debug_agent([&](const DebugAgentPtr & pAgent){
886 pAgent->onUninstall(oldAgentPtr);
887 });
888 }
889 g_DebugAgents[category] = {
890 debugAgentContextOrNull(context),
891 newAgent
892 };
893 DebugAgent * newAgentPtr = newAgent.get();
894 for_each_debug_agent([&](const DebugAgentPtr & pAgent){
895 pAgent->onInstall(newAgentPtr);
896 });
897 }
898
899 Context & getDebugAgentContext ( const char * category, LineInfoArg * at, Context * context ) {
900 if ( !category ) context->throw_error_at(at, "need to specify category");

Callers

nothing calls this directly

Calls 8

for_each_debug_agentFunction · 0.85
debugAgentContextOrNullFunction · 0.85
throw_error_atMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45
onUninstallMethod · 0.45
onInstallMethod · 0.45

Tested by

no test coverage detected