diff --git a/.gitignore b/.gitignore index 727425e..b405b66 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ !.vscode/settings.json !.vscode/c_cpp_properties.json !.vscode/tasks.json +!.vscode/launch.json !.vscode/README.md *.o diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f40d2d7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "开始Debug", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/chsrc-debug", + "args": [ + "get", + "python" + ], + "preLaunchTask": "构建 debug 版 chsrc", + "stopAtEntry": true, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + // "miDebuggerPath": "/path/to/gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e6a1413..5eb4def 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -17,6 +17,23 @@ }, "detail": "使用 just build 编译" }, + { + "type": "shell", + "label": "构建 debug 版 chsrc", + "command": "just", + "args": ["DEBUG=1", "build"], + "options": { + "cwd": "${workspaceFolder}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "使用 just DEBUG=1 build 编译 debug 版" + }, { "type": "shell", "label": "测试 chsrc",