Compare commits

...

3 Commits

Author SHA1 Message Date
flykhan 74cfa83754 添加Vscode终端调试 2023-03-26 18:09:07 +08:00
flykhan d327228541 重中之重:添加了可以自定义的C、C++配置文件 2023-03-26 17:53:38 +08:00
flykhan 631cc7e88b 删除无关配置 2023-03-26 17:52:22 +08:00
4 changed files with 190 additions and 73 deletions

View File

@ -1,40 +0,0 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/x86_64-w64-mingw32",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/backward",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/tr1",
"D:/mingw64/x86_64-w64-mingw32/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/x86_64-w64-mingw32",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/backward",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include",
"D:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/tr1",
"D:/mingw64/x86_64-w64-mingw32/include"
]
},
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "",
"compilerPath": "D:/mingw64/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++11"
}
],
"version": 4
}

65
.vscode/launch.json vendored
View File

@ -1,19 +1,60 @@
// https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceRoot}\\${fileBasename}.exe",
"miDebuggerPath":"D:\\mingw64\\bin\\gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "g++"
"name": "(gdb) Launch", //
"type": "cppdbg", // cppdbgcpptoolscppdbg
"request": "launch", // launchattach
"program": "C:\\Windows\\system32\\cmd.exe", // (debug)
// "program": "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", // (debug)
// "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", // (Windows'\\')
// "program": "${fileDirname}/${fileBasenameNoExtension}.exe", // (Linux'/')
"args": ["/C","${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe","&","pause"], //
// "args": [], //
"stopAtEntry": false, // truemain
"cwd": "${workspaceFolder}", // ${fileDirname}
"environment": [], //
"externalConsole": true, // true使cmdIDE1810falseVSC
// "externalConsole": false, // true使cmdIDE1810falseVSC
"internalConsoleOptions": "neverOpen", // neverOpengdb
"MIMode": "gdb", // gdblldblldb
"miDebuggerPath": "gdb.exe", // WindowsLinux
"setupCommands": [
{ // STLGoogle
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "Compile" // tasks.jsonlabel
},
{
"name": "(gdb) Debug", //
"type": "cppdbg", // cppdbgcpptoolscppdbg
"request": "launch", // launchattach
// "program": "C:\\Windows\\system32\\cmd.exe", // (debug)
"program": "${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", // (debug)
// "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", // (Windows'\\')
// "program": "${fileDirname}/${fileBasenameNoExtension}.exe", // (Linux'/')
// "args": ["/C","${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe","&","pause"], //
"args": [], //
"stopAtEntry": false, // truemain
"cwd": "${workspaceFolder}", // ${fileDirname}
"environment": [], //
// "externalConsole": true, // true使cmdIDE1810falseVSC
"externalConsole": false, // true使cmdIDE1810falseVSC
"internalConsoleOptions": "neverOpen", // neverOpengdb
"MIMode": "gdb", // gdblldblldb
"miDebuggerPath": "gdb.exe", // WindowsLinux
"setupCommands": [
{ // STLGoogle
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "Compile" // tasks.jsonlabel
}
]
}

110
.vscode/settings.json vendored
View File

@ -1,7 +1,109 @@
{
"files.associations": {
"*.js": "javascript",
"iostream": "cpp"
"workbench.sideBar.location": "left",
"window.title": "${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}",
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?·~!¥…()—【】、;:‘’“”,。《》? ",
"files.defaultLanguage": "c++", // ctrl+N
"editor.formatOnType": false, // C/C++
"editor.suggest.snippetsPreventQuickSuggestions": true, // clangdsnippetsIntellisense
"editor.acceptSuggestionOnEnter": "off", // tabIntellisense
"editor.snippetSuggestions": "inline", // snippetsinline
"C_Cpp.clang_format_sortIncludes": true, // include
"C_Cpp.autocomplete": "default", // cpptoolsclangd
"C_Cpp.suggestSnippets": true, //
"editor.fontFamily": "JetBrains Mono",
"editor.fontSize": 17, //
"editor.fontLigatures": true, // https://typeof.net/Iosevka
"editor.minimap.enabled": false, // minimap西
"editor.dragAndDrop": false, //
"editor.cursorSmoothCaretAnimation": "on", //
"editor.smoothScrolling": false, //
"files.trimTrailingWhitespace": true, //
"files.insertFinalNewline": true, // Linux
"files.autoGuessEncoding": true, // 6
"workbench.settings.useSplitJSON": false, //
"window.zoomLevel": 0, //
"git.enabled": true, // git
"git.ignoreMissingGitWarning": true, //
"[c]": {
"files.encoding": "utf8" // gbkcpp
},
"C_Cpp.errorSquiggles": "disabled"
"[c++]": {
"files.encoding": "utf8" // gbkcpp
},
"files.associations": {
"iostream": "cpp",
"algorithm": "cpp",
"*.tcc": "cpp",
"random": "cpp",
"fstream": "cpp",
"istream": "cpp",
"ostream": "cpp",
"regex": "cpp",
"utility": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ratio": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"queue": "cpp"
},
"C_Cpp.errorSquiggles": "Enabled",
}

42
.vscode/tasks.json vendored
View File

@ -1,17 +1,31 @@
// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
"command": "g++",
"args": ["-g","-std=c++11","${file}","-o","${workspaceRoot}\\${fileBasename}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
"tasks": [{
"label": "Compile", // launch.jsonpreLaunchTask
"command": "g++", // 使C++g++
"args": [
"${file}",
"-o", // a.exeLinuxa.out
// "${fileDirname}/${fileBasenameNoExtension}.exe",
"${workspaceFolder}\\debug\\${fileBasenameNoExtension}.exe", // debug
"-g", //
"-Wall", //
"-static-libgcc", // libgcc
"-fexec-charset=utf-8", // 使GBKWin
// "-std=c11", // C++c++17
], // VSC西
"type": "process", // processvsccommandshellshellargsshell
"group": {
"kind": "build",
"isDefault": true // truectrl shift B
},
"presentation": {
"echo": true,
"reveal": "always", // alwayssilentneverVSC
"focus": false, // true使taskC/C++true
"panel": "shared" //
},
"problemMatcher":"$gcc" // Lint
}]
}