Skip to content

Commit 211e98c

Browse files
committed
Add VS Code debug launch
1 parent f312dd3 commit 211e98c

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
!.vscode/settings.json
33
!.vscode/c_cpp_properties.json
44
!.vscode/tasks.json
5+
!.vscode/launch.json
56
!.vscode/README.md
67

78
*.o

.vscode/launch.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "开始Debug",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/chsrc-debug",
9+
"args": [
10+
"get",
11+
"python"
12+
],
13+
"preLaunchTask": "构建 debug 版 chsrc",
14+
"stopAtEntry": true,
15+
"cwd": "${fileDirname}",
16+
"environment": [],
17+
"externalConsole": false,
18+
"MIMode": "gdb",
19+
// "miDebuggerPath": "/path/to/gdb",
20+
"setupCommands": [
21+
{
22+
"description": "Enable pretty-printing for gdb",
23+
"text": "-enable-pretty-printing",
24+
"ignoreFailures": true
25+
},
26+
{
27+
"description": "Set Disassembly Flavor to Intel",
28+
"text": "-gdb-set disassembly-flavor intel",
29+
"ignoreFailures": true
30+
}
31+
]
32+
}
33+
]
34+
}

.vscode/tasks.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@
1717
},
1818
"detail": "使用 just build 编译"
1919
},
20+
{
21+
"type": "shell",
22+
"label": "构建 debug 版 chsrc",
23+
"command": "just",
24+
"args": ["DEBUG=1", "build"],
25+
"options": {
26+
"cwd": "${workspaceFolder}"
27+
},
28+
"problemMatcher": [
29+
"$gcc"
30+
],
31+
"group": {
32+
"kind": "build",
33+
"isDefault": true
34+
},
35+
"detail": "使用 just DEBUG=1 build 编译 debug 版"
36+
},
2037
{
2138
"type": "shell",
2239
"label": "测试 chsrc",

0 commit comments

Comments
 (0)