{"id":365,"date":"2024-07-12T09:38:16","date_gmt":"2024-07-12T01:38:16","guid":{"rendered":"https:\/\/blog.kishere.cn\/?p=365"},"modified":"2024-09-05T10:34:37","modified_gmt":"2024-09-05T02:34:37","slug":"vscode%e7%bc%96%e8%af%91%e3%80%81%e8%b0%83%e8%af%95c%e7%9a%84json%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/blog.kishere.cn\/?p=365","title":{"rendered":"VSCode\u7f16\u8bd1\u3001\u8c03\u8bd5C++\u7684json\u914d\u7f6e\u6587\u4ef6"},"content":{"rendered":"<h2>\u51c6\u5907\u5de5\u4f5c<\/h2>\n<ol>\n<li>vscode<\/li>\n<li>\u4e0b\u8f7dC++\u63d2\u4ef6<\/li>\n<\/ol>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_25ac9c99f6bb81809fe9a776041f97a6.jpg\"><img decoding=\"async\" src=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_25ac9c99f6bb81809fe9a776041f97a6.jpg\" alt=\"C++\u63d2\u4ef6\" \/><\/a><br \/>\n\u5c31\u4e0b\u8fd9\u4e2a\u5c31\u884c\uff0c\u522b\u7684\u4e0d\u9700\u8981\uff0c\u5982\u679c\u662f\u8fdc\u7a0b\u5230Linux\uff0c\u8981\u52a0\u4e0aremote\u63d2\u4ef6<\/p>\n<h2>\u4ee3\u7801\u89e3\u6790\u914d\u7f6e<\/h2>\n<p>ctrl+shift+p\uff0c\u9009\u62e9C++:\u7f16\u8f91\u914d\u7f6e<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_4d7dd799290d1d638f21443a9e565bb2.jpg\"><img decoding=\"async\" src=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_4d7dd799290d1d638f21443a9e565bb2.jpg\" alt=\"\" \/><\/a><\/p>\n<pre><code class=\"language-json line-numbers\">{\n    \"configurations\": [\n        {\n            \"name\": \"Linux\",\n            \"includePath\": [\/\/\u5934\u6587\u4ef6\u641c\u7d22\u76ee\u5f55\uff0c\n                \"${workspaceFolder}\/**\",\/\/\u8fd9\u4e2a\u8868\u793a\u5de5\u4f5c\u533a\u8def\u5f84\u4e0b\u6240\u6709\u5b50\u76ee\u5f55\n                \"\/usr\/include\/aarch64-linux-gnu\/qt5\/QtCore\",\n                \"\/usr\/include\/aarch64-linux-gnu\/qt5\"\n            ],\n            \"defines\": [],\n            \"compilerPath\": \"\/usr\/bin\/gcc\", \/\/\u7f16\u8bd1\u5668\u8def\u5f84\n            \"cStandard\": \"c11\",\n            \"cppStandard\": \"c++17\", \/\/C++\u6807\u51c6\n            \"intelliSenseMode\": \"linux-gcc-arm64\"\n        }\n    ],\n    \"version\": 4\n}\n<\/code><\/pre>\n<h2>\u7f16\u8bd1\u914d\u7f6e<\/h2>\n<p>\u70b9\u914d\u7f6e\u4efb\u52a1<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_dc321dee1eb7ea16d23e266250fb27f3.jpg\"><img decoding=\"async\" src=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_dc321dee1eb7ea16d23e266250fb27f3.jpg\" alt=\"\" \/><\/a><\/p>\n<pre><code class=\"language-json line-numbers\">{\n    \"version\": \"2.0.0\",\n    \"tasks\": [\/\/\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2a\u4efb\u52a1\n        {\n            \"type\": \"cppbuild\",\/\/\u8fd9\u4e2a\u6539\u4e0d\u4e86\n            \"label\": \"exe qmake\",\/\/\u663e\u793a\u7684\u540d\u79f0\n            \"command\": \"qmake\",\/\/\u6267\u884c\u7684\u547d\u4ee4\n            \"args\": [\n                \"<span class=\"katex math inline\">{workspaceFolder}\/exe\/exe.pro\"\/\/\u547d\u4ee4\u884c\u53c2\u6570\n            ],\n            \"options\": {\n                \"cwd\": \"<\/span>{workspaceFolder}\/exe\"\/\/\u547d\u4ee4\u884c\u6267\u884c\u4f4d\u7f6e\uff0c\u5bf9\u4e8eqmake\uff0c\u4f1a\u5728\u6267\u884cqmake\u7684\u5730\u65b9\u751f\u6210makefile\n            },\n            \"group\": \"build\",\/\/\u8fd9\u4e2a\u8981\u6539\u6ca1\u51e0\u4e2a\u80fd\u9009\u7684\uff0c\u5efa\u8bae\u4e0d\u6539\n            \"detail\": \"qmake\"\/\/\u663e\u793a\u7684\u63cf\u8ff0\n        },\n        {\n            \"type\": \"cppbuild\",\n            \"label\": \"exe make debug\",\n            \"command\": \"make\",\n            \"args\": [\n                \"debug\",\n                \"-j2\"\n            ],\n            \"options\": {\n                \"cwd\": \"<span class=\"katex math inline\">{workspaceFolder}\/exe\"\n            },\n            \"dependsOn\": [\n                \"Hal qmake\"\n            ],\n            \"group\": \"build\",\n            \"detail\": \"make debug \"\n        },\n        {\n            \"type\": \"cppbuild\",\n            \"label\": \"Hal clean\",\n            \"command\": \"make\",\n            \"args\": [\n                \"distclean\"\n            ],\n            \"options\": {\n                \"cwd\": \"<\/span>{workspaceFolder}\/exe\"\n            },\n            \"group\": \"build\",\n            \"detail\": \"Hal make clean\"\n        },\n    ]\n}\n<\/code><\/pre>\n<h2>\u8c03\u8bd5\u914d\u7f6e<\/h2>\n<p>\u70b9\u8fd9\u91cc\uff0c\u589e\u52a0\u4e00\u4e2a\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\uff0c\u70b9\u53f3\u4e0b\u89d2\u7684\u6dfb\u52a0\u914d\u7f6e\u5c31\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u9879\u3002<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_08ac210e469128248e2b5e82bea0e04d.jpg\"><img decoding=\"async\" src=\"https:\/\/blog.kishere.cn\/wp-content\/uploads\/2024\/07\/wp_editor_md_08ac210e469128248e2b5e82bea0e04d.jpg\" alt=\"\" \/><\/a><\/p>\n<pre><code class=\"language-json line-numbers\">{\n\n    \"version\": \"0.2.0\",\n    \"configurations\": [\/\/\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u591a\u4e2a\uff0c\u6bd4\u5982\u4e00\u4e2alaunch\u4e00\u4e2aattach\n        {\n            \"name\": \"(gdb) \u9644\u52a0\",\n            \"type\": \"cppdbg\",\n            \"request\": \"attach\",\n            \"processId\":\"<span class=\"katex math inline\">{command:pickProcess}\",\/\/\u52a0\u5165\u8fd9\u4e2a\u7528\u6765\u9009\u62e9\u9700\u8981\u9644\u52a0\u7684\u8fdb\u7a0b\n            \"program\": \"<\/span>{workspaceFolder}\/bin\/Debug\/exe\",\/\/\u8981\u8c03\u8bd5\u7684\u7a0b\u5e8f\n            \"MIMode\": \"gdb\",\n            \"setupCommands\": [\n                {\n                    \"description\": \"\u4e3a gdb \u542f\u7528\u6574\u9f50\u6253\u5370\",\n                    \"text\": \"-enable-pretty-printing\",\n                    \"ignoreFailures\": true\n                },\n                {\n                    \"description\": \"\u5c06\u53cd\u6c47\u7f16\u98ce\u683c\u8bbe\u7f6e\u4e3a Intel\",\n                    \"text\": \"-gdb-set disassembly-flavor intel\",\n                    \"ignoreFailures\": true\n                }\n            ]\n        },\n        {\n            \"name\": \"(gdb) \u542f\u52a8\",\n            \"type\": \"cppdbg\",\n            \"request\": \"launch\",\n            \"program\": \"<span class=\"katex math inline\">{workspaceFolder}\/bin\/Debug\/exe\",\n            \"args\": [],\n            \"stopAtEntry\": false,\n            \"cwd\": \"<\/span>{workspaceFolder}\/bin\/Debug\/\",\n            \"environment\": [],\n            \"externalConsole\": false,\n            \"MIMode\": \"gdb\",\n            \"setupCommands\": [\n                {\n                    \"description\": \"\u4e3a gdb \u542f\u7528\u6574\u9f50\u6253\u5370\",\n                    \"text\": \"-enable-pretty-printing\",\n                    \"ignoreFailures\": true\n                },\n                {\n                    \"description\": \"\u5c06\u53cd\u6c47\u7f16\u98ce\u683c\u8bbe\u7f6e\u4e3a Intel\",\n                    \"text\": \"-gdb-set disassembly-flavor intel\",\n                    \"ignoreFailures\": true\n                }\n            ]\n        }\n    ]\n}\n<\/code><\/pre>\n<h2>Remote\u7684\u6587\u4ef6\u5939<\/h2>\n<p>ssh\u8fde\u63a5linux\u65f6\uff0c\u4f1a\u5728Linux\u4e0a\u521b\u5efa\u4e00\u4e9b\u6587\u4ef6\uff1a<\/p>\n<ul>\n<li>~\/.vscode-server \u4fdd\u5b58\u6269\u5c55\u63d2\u4ef6\u7684\u4f4d\u7f6e<\/li>\n<li>~\/.cache\/vscode-cpptools \u4fdd\u5b58\u6587\u4ef6\u8df3\u8f6c\u7f13\u5b58\uff0c\u91cc\u9762\u7684ipch\u5360\u7528\u7a7a\u95f4\u5f88\u5927\uff0c\u53ef\u4ee5\u5220\u9664\uff0c\u6ca1\u6709\u592a\u5927\u5f71\u54cd\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u51c6\u5907\u5de5\u4f5c vscode \u4e0b\u8f7dC++\u63d2\u4ef6 \u5c31\u4e0b\u8fd9\u4e2a\u5c31\u884c\uff0c\u522b\u7684\u4e0d\u9700\u8981\uff0c\u5982\u679c\u662f\u8fdc\u7a0b\u5230Linux\uff0c\u8981\u52a0\u4e0aremote\u63d2\u4ef6 \u4ee3\u7801\u89e3\u6790\u914d\u7f6e ctrl+shift+p\uff0c\u9009\u62e9C++:\u7f16\u8f91\u914d\u7f6e { &#8220;configurations&#8221;: [ { &#8220;name&#8221;: &#8220;Linux&#8221;, &#8220;includePath&#8221;: [\/\/\u5934\u6587\u4ef6\u641c\u7d22\u76ee\u5f55\uff0c &#8220;${workspaceFolder}\/**&#8221;,\/\/\u8fd9\u4e2a\u8868\u793a\u5de5\u4f5c\u533a\u8def\u5f84\u4e0b\u6240\u6709\u5b50\u76ee\u5f55 &#8220;\/usr\/include\/aarch64-linux-gnu\/qt5\/QtCore&#8221;, &#8220;\/usr\/include\/aarch64-linux-gnu\/qt5&#8221; ], &#8220;defines&#8221;: [], &#8220;compilerPath&#8221;: &#8220;\/usr\/bin\/gcc&#8221;, \/\/\u7f16\u8bd1\u5668\u8def\u5f84 &#8220;cStandard&#8221;: &#8220;c11&#8221;, &#8220;cppStandard&#8221;: &#8220;c++17&#8221;, \/\/C++\u6807\u51c6 &#8220;intelliSenseMode&#8221;: &#8220;linux-gcc-arm64&#8221; } ], &#8220;version&#8221;: 4 } \u7f16\u8bd1\u914d\u7f6e \u70b9\u914d\u7f6e\u4efb\u52a1 { &#8220;version&#8221;: &#8220;2.0.0&#8221;, &#8220;tasks&#8221;: [\/\/\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2a\u4efb\u52a1 { &#8220;type&#8221;: &#8220;cppbuild&#8221;,\/\/\u8fd9\u4e2a\u6539\u4e0d\u4e86 &#8220;label&#8221;: &#8220;exe qmake&#8221;,\/\/\u663e\u793a\u7684\u540d\u79f0 &#8220;command&#8221;: &#8220;qmake&#8221;,\/\/\u6267\u884c\u7684\u547d\u4ee4 &#8220;args&#8221;: [ &#8220;{workspaceFolder}\/exe\/exe.pro&#8221;\/\/\u547d\u4ee4\u884c\u53c2\u6570 ], &#8220;options&#8221;: { &#8220;cwd&#8221;: &#8220;{workspaceFolder}\/exe&#8221;\/\/\u547d\u4ee4\u884c\u6267\u884c\u4f4d\u7f6e\uff0c\u5bf9\u4e8eqmake\uff0c\u4f1a\u5728\u6267\u884cqmake\u7684\u5730\u65b9\u751f\u6210makefile }, &#8220;group&#8221;: &#8220;build&#8221;,\/\/\u8fd9\u4e2a\u8981\u6539\u6ca1\u51e0\u4e2a\u80fd\u9009\u7684\uff0c\u5efa\u8bae\u4e0d\u6539 &#8220;detail&#8221;: &#8220;qmake&#8221;\/\/\u663e\u793a\u7684\u63cf\u8ff0 }, { &#8220;type&#8221;: &#8220;cppbuild&#8221;, &#8220;label&#8221;: &#8220;exe make debug&#8221;, &#8220;command&#8221;: &#8220;make&#8221;, &#8220;args&#8221;: [ &#8220;debug&#8221;, &#8220;-j2&#8221; ], &#8220;options&#8221;: { &#8220;cwd&#8221;: &#8220;{workspaceFolder}\/exe&#8221; }, &#8220;dependsOn&#8221;: [ &#8220;Hal qmake&#8221; ], &#8220;group&#8221;: &#8220;build&#8221;, &#8220;detail&#8221;: &#8220;make debug &#8221; }, { &#8220;type&#8221;: &#8220;cppbuild&#8221;, &#8220;label&#8221;: &#8220;Hal clean&#8221;, &#8220;command&#8221;: &#8220;make&#8221;, &#8220;args&#8221;: [ &#8220;distclean&#8221; ], &#8220;options&#8221;: { &#8220;cwd&#8221;: &#8220;{workspaceFolder}\/exe&#8221; }, &#8220;group&#8221;: &#8220;build&#8221;, &#8220;detail&#8221;: &#8220;Hal make clean&#8221; }, ] } \u8c03\u8bd5\u914d\u7f6e \u70b9\u8fd9\u91cc\uff0c\u589e\u52a0\u4e00\u4e2a\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\uff0c\u70b9\u53f3\u4e0b\u89d2\u7684\u6dfb\u52a0\u914d\u7f6e\u5c31\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u9879\u3002 { &#8220;version&#8221;: &#8220;0.2.0&#8221;, &#8220;configurations&#8221;: [\/\/\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u591a\u4e2a\uff0c\u6bd4\u5982\u4e00\u4e2alaunch\u4e00\u4e2aattach { &#8220;name&#8221;: &#8220;(gdb) \u9644\u52a0&#8221;, &#8220;type&#8221;: &#8220;cppdbg&#8221;, &#8220;request&#8221;: &#8220;attach&#8221;, &#8220;processId&#8221;:&#8221;{command:pickProcess}&#8221;,\/\/\u52a0\u5165\u8fd9\u4e2a\u7528\u6765\u9009\u62e9\u9700\u8981\u9644\u52a0\u7684\u8fdb\u7a0b &#8220;program&#8221;: &#8220;{workspaceFolder}\/bin\/Debug\/exe&#8221;,\/\/\u8981\u8c03\u8bd5\u7684\u7a0b\u5e8f &#8220;MIMode&#8221;: &#8220;gdb&#8221;, &#8220;setupCommands&#8221;: [ { &#8220;description&#8221;: &#8220;\u4e3a gdb \u542f\u7528\u6574\u9f50\u6253\u5370&#8221;, &#8220;text&#8221;: &#8220;-enable-pretty-printing&#8221;, &#8220;ignoreFailures&#8221;: true }, { &#8220;description&#8221;: &#8220;\u5c06\u53cd\u6c47\u7f16\u98ce\u683c\u8bbe\u7f6e\u4e3a Intel&#8221;, &#8220;text&#8221;: &#8220;-gdb-set disassembly-flavor intel&#8221;, &#8220;ignoreFailures&#8221;: true } ] }, { &#8220;name&#8221;: &#8220;(gdb) \u542f\u52a8&#8221;, &#8220;type&#8221;: &#8220;cppdbg&#8221;, &#8220;request&#8221;: &#8220;launch&#8221;, &#8220;program&#8221;: &#8220;{workspaceFolder}\/bin\/Debug\/exe&#8221;, &#8220;args&#8221;: [], &#8220;stopAtEntry&#8221;: false, &#8220;cwd&#8221;: &#8220;{workspaceFolder}\/bin\/Debug\/&#8221;, &#8220;environment&#8221;: [], &#8220;externalConsole&#8221;: false, &#8220;MIMode&#8221;: &#8220;gdb&#8221;, &#8220;setupCommands&#8221;: [ { &#8220;description&#8221;: &#8220;\u4e3a gd&#8230;<\/p>\n","protected":false},"author":1,"featured_media":370,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/365"}],"collection":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365"}],"version-history":[{"count":5,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/posts\/365\/revisions\/392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=\/wp\/v2\/media\/370"}],"wp:attachment":[{"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kishere.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}