MCPcopy Create free account
hub / github.com/Kitware/CMake / GetScopesResponse

Method GetScopesResponse

Source/cmDebuggerThread.cxx:70–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70dap::ScopesResponse cmDebuggerThread::GetScopesResponse(
71 int64_t frameId, bool supportsVariableType)
72{
73 std::unique_lock<std::mutex> lock(Mutex);
74 auto it = FrameScopes.find(frameId);
75
76 if (it != FrameScopes.end()) {
77 dap::ScopesResponse response;
78 response.scopes = it->second;
79 return response;
80 }
81
82 auto it2 = FrameMap.find(frameId);
83 if (it2 == FrameMap.end()) {
84 return dap::ScopesResponse();
85 }
86
87 std::shared_ptr<cmDebuggerStackFrame> frame = it2->second;
88 std::shared_ptr<cmDebuggerVariables> localVariables =
89 cmDebuggerVariablesHelper::Create(VariablesManager, "Locals",
90 supportsVariableType, frame);
91
92 FrameVariables[frameId].emplace_back(localVariables);
93
94 dap::Scope scope;
95 scope.name = localVariables->GetName();
96 scope.presentationHint = "locals";
97 scope.variablesReference = localVariables->GetId();
98
99 dap::Source source;
100 source.name = frame->GetFileName();
101 source.path = source.name;
102 scope.source = source;
103
104 FrameScopes[frameId].push_back(scope);
105
106 dap::ScopesResponse response;
107 response.scopes.push_back(scope);
108 return response;
109}
110
111dap::VariablesResponse cmDebuggerThread::GetVariablesResponse(
112 dap::VariablesRequest const& request)

Callers 1

cmDebuggerAdapterMethod · 0.80

Calls 8

ScopesResponseClass · 0.85
emplace_backMethod · 0.80
push_backMethod · 0.80
findMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45
GetIdMethod · 0.45
GetFileNameMethod · 0.45

Tested by

no test coverage detected