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

Method SourceFileLoaded

Source/cmDebuggerBreakpointManager.cxx:125–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void cmDebuggerBreakpointManager::SourceFileLoaded(
126 std::string const& sourcePath,
127 std::vector<cmListFileFunction> const& functions)
128{
129 std::unique_lock<std::mutex> lock(Mutex);
130 if (ListFileFunctionLines.find(sourcePath) != ListFileFunctionLines.end()) {
131 // this is not expected.
132 return;
133 }
134
135 for (cmListFileFunction const& func : functions) {
136 ListFileFunctionLines[sourcePath].emplace_back(
137 cmDebuggerFunctionLocation{ func.Line(), func.LineEnd() });
138 }
139
140 if (ListFilePendingValidations.find(sourcePath) ==
141 ListFilePendingValidations.end()) {
142 return;
143 }
144
145 ListFilePendingValidations.erase(sourcePath);
146
147 for (size_t i = 0; i < Breakpoints[sourcePath].size(); i++) {
148 dap::BreakpointEvent breakpointEvent;
149 breakpointEvent.breakpoint.id = Breakpoints[sourcePath][i].GetId();
150 breakpointEvent.breakpoint.line = Breakpoints[sourcePath][i].GetLine();
151 auto source = dap::Source();
152 source.path = sourcePath;
153 breakpointEvent.breakpoint.source = source;
154 int64_t correctedLine = CalibrateBreakpointLine(
155 sourcePath, Breakpoints[sourcePath][i].GetLine());
156 if (correctedLine != Breakpoints[sourcePath][i].GetLine()) {
157 Breakpoints[sourcePath][i].ChangeLine(correctedLine);
158 }
159 breakpointEvent.reason = "changed";
160 breakpointEvent.breakpoint.verified = (correctedLine > 0);
161 if (breakpointEvent.breakpoint.verified) {
162 breakpointEvent.breakpoint.line = correctedLine;
163 } else {
164 Breakpoints[sourcePath][i].Invalid();
165 }
166
167 DapSession->send(breakpointEvent);
168 }
169}
170
171std::vector<int64_t> cmDebuggerBreakpointManager::GetBreakpoints(
172 std::string const& sourcePath, int64_t line)

Calls 13

SourceClass · 0.85
emplace_backMethod · 0.80
LineMethod · 0.80
LineEndMethod · 0.80
eraseMethod · 0.80
ChangeLineMethod · 0.80
InvalidMethod · 0.80
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
GetIdMethod · 0.45
GetLineMethod · 0.45