Skip to content

修复 c++ 调试 断点问题 #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
"**/node_modules": true,
".vscode-test": true
},
"files.associations": {
"*.gafq": "lua",
"functional": "cpp"
},
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## version 2.17.5

- 修复 c++ 调试 断点问题

## version 2.17.4

- 多语言配置缺少 main.contributes.commands.lcpr.simpleDebug.title
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-leetcode-problem-rating",
"displayName": "LeetCode",
"description": "%main.description%",
"version": "2.17.4",
"version": "2.17.5",
"author": "ccagml",
"publisher": "ccagml",
"license": "MIT",
Expand Down
29 changes: 23 additions & 6 deletions src/debugex/debugCpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class DebugCpp extends DebugBase {
Object.assign({}, debugConfig, {
request: "launch",
name: debugSessionName,
logging: { engineLogging: true, trace: true, traceResponse: true },
args,
})
);
Expand Down Expand Up @@ -315,11 +316,17 @@ class DebugCpp extends DebugBase {

event.removed.map((bp: vscode.SourceBreakpoint) => {
if (bp.location.uri.fsPath === filePath) {
const location: vscode.Location = new vscode.Location(
vscode.Uri.file(newSourceFilePath),
bp.location.range
);
vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]);
const aaa: vscode.Breakpoint[] = [];
vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => {
if (
all_bp_one.location.uri.fsPath === newSourceFilePath &&
all_bp_one.location.range.start.line == bp.location.range.start.line &&
all_bp_one.location.range.end.line == bp.location.range.end.line
) {
aaa.push(all_bp_one);
}
});
vscode.debug.removeBreakpoints(aaa);
}
});

Expand All @@ -329,7 +336,17 @@ class DebugCpp extends DebugBase {
vscode.Uri.file(newSourceFilePath),
bp.location.range
);
vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]);
const aaa: vscode.Breakpoint[] = [];
vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => {
if (
all_bp_one.location.uri.fsPath === newSourceFilePath &&
all_bp_one.location.range.start.line == bp.location.range.start.line &&
all_bp_one.location.range.end.line == bp.location.range.end.line
) {
aaa.push(all_bp_one);
}
});
vscode.debug.removeBreakpoints(aaa);
vscode.debug.addBreakpoints([
new vscode.SourceBreakpoint(location, bp.enabled, bp.condition, bp.hitCondition, bp.logMessage),
]);
Expand Down