Skip to content

Commit 2cc3a02

Browse files
authored
Merge pull request #194 from ccagml/main
修复 c++ 调试 断点问题
2 parents 09d7657 + ec1c9db commit 2cc3a02

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@
99
"**/node_modules": true,
1010
".vscode-test": true
1111
},
12+
"files.associations": {
13+
"*.gafq": "lua",
14+
"functional": "cpp"
15+
},
1216
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## version 2.17.5
2+
3+
- 修复 c++ 调试 断点问题
4+
15
## version 2.17.4
26

37
- 多语言配置缺少 main.contributes.commands.lcpr.simpleDebug.title

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-leetcode-problem-rating",
33
"displayName": "LeetCode",
44
"description": "%main.description%",
5-
"version": "2.17.4",
5+
"version": "2.17.5",
66
"author": "ccagml",
77
"publisher": "ccagml",
88
"license": "MIT",

src/debugex/debugCpp.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ class DebugCpp extends DebugBase {
277277
Object.assign({}, debugConfig, {
278278
request: "launch",
279279
name: debugSessionName,
280+
logging: { engineLogging: true, trace: true, traceResponse: true },
280281
args,
281282
})
282283
);
@@ -315,11 +316,17 @@ class DebugCpp extends DebugBase {
315316

316317
event.removed.map((bp: vscode.SourceBreakpoint) => {
317318
if (bp.location.uri.fsPath === filePath) {
318-
const location: vscode.Location = new vscode.Location(
319-
vscode.Uri.file(newSourceFilePath),
320-
bp.location.range
321-
);
322-
vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]);
319+
const aaa: vscode.Breakpoint[] = [];
320+
vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => {
321+
if (
322+
all_bp_one.location.uri.fsPath === newSourceFilePath &&
323+
all_bp_one.location.range.start.line == bp.location.range.start.line &&
324+
all_bp_one.location.range.end.line == bp.location.range.end.line
325+
) {
326+
aaa.push(all_bp_one);
327+
}
328+
});
329+
vscode.debug.removeBreakpoints(aaa);
323330
}
324331
});
325332

@@ -329,7 +336,17 @@ class DebugCpp extends DebugBase {
329336
vscode.Uri.file(newSourceFilePath),
330337
bp.location.range
331338
);
332-
vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]);
339+
const aaa: vscode.Breakpoint[] = [];
340+
vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => {
341+
if (
342+
all_bp_one.location.uri.fsPath === newSourceFilePath &&
343+
all_bp_one.location.range.start.line == bp.location.range.start.line &&
344+
all_bp_one.location.range.end.line == bp.location.range.end.line
345+
) {
346+
aaa.push(all_bp_one);
347+
}
348+
});
349+
vscode.debug.removeBreakpoints(aaa);
333350
vscode.debug.addBreakpoints([
334351
new vscode.SourceBreakpoint(location, bp.enabled, bp.condition, bp.hitCondition, bp.logMessage),
335352
]);

0 commit comments

Comments
 (0)