| 68 | } |
| 69 | |
| 70 | dap::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 | |
| 111 | dap::VariablesResponse cmDebuggerThread::GetVariablesResponse( |
| 112 | dap::VariablesRequest const& request) |
no test coverage detected