{"id":957,"date":"2022-01-05T10:57:44","date_gmt":"2022-01-05T02:57:44","guid":{"rendered":"http:\/\/www.danios.com\/?p=957"},"modified":"2022-03-15T16:23:33","modified_gmt":"2022-03-15T08:23:33","slug":"debian-11%e9%85%8d%e7%bd%aevscode%ef%bc%8c%e8%bf%9b%e8%a1%8cc-c%e5%ad%a6%e4%b9%a0","status":"publish","type":"post","link":"https:\/\/www.oceansource.cc\/?p=957","title":{"rendered":"Debian 11\u914d\u7f6evscode\uff0c\u8fdb\u884cc\/c++\u5b66\u4e60"},"content":{"rendered":"\n<p>\u6700\u8fd1\u7528Debian 11\uff0c\u8fdb\u884cC\u5b66\u4e60\uff0c\u60f3\u7528VScode\u6765\u914d\u7f6e\u73af\u5883\uff0c\u4f46\u662f\u53d1\u73b0\u6709\u5f88\u591a\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982g++\u627e\u4e0d\u5230\uff0claunch file doesn&#8217;t exist\u3002<\/p>\n\n\n\n<p>\u770b\u4e86\u7f51\u4e0a\u5f88\u591a\u6559\u7a0b\u4e5f\u6ca1\u641e\u5b9a\uff0c\u5168\u662f\u62f7\u8d1d\u7c98\u8d34\u7684\uff0c\u6240\u4ee5\u53bb\u770b\u4e86\u5b98\u65b9\u6587\u6863\uff0c\u4e00\u4e0b\u5b50\u89e3\u51b3\u4e86\uff0c\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n\n\n\n<p>\u5b98\u65b9\u6587\u6863\uff1a<a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/config-linux\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.visualstudio.com\/docs\/cpp\/config-linux<\/a><\/p>\n\n\n\n<p>\u4e3b\u8981\u53c2\u8003\u4e86\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u6c49\u5316\uff0c\u8c03\u6574<\/p>\n\n\n\n<p><strong>1\u3001\u5b89\u88c5\u5fc5\u8981\u8f6f\u4ef6\u63d2\u4ef6<\/strong><\/p>\n\n\n\n<p>    1\u3001\u5b89\u88c5&nbsp;<a href=\"https:\/\/code.visualstudio.com\/download\">Visual Studio Code<\/a>. <\/p>\n\n\n\n<p>        \u76f4\u63a5\u4e0b\u8f7d\uff0c\u7136\u540e\u5b89\u88c5\u5373\u53ef\uff0c\u53c2\u8003\u547d\u4ee4\uff1asudo dpkg -i ****.deb<\/p>\n\n\n\n<p>    2\u3001\u5b89\u88c5&nbsp;<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\" target=\"_blank\" rel=\"noreferrer noopener\">C++ extension for VS Code<\/a>. <\/p>\n\n\n\n<p>         \u5728\u63d2\u4ef6\u91cc\u9762\u641c\u7d22\u5373\u53ef\uff0c\u6216\u8005\u6309Ctrl+Shift+X<img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/cpp\/cpp-extension.png\" alt=\"C\/C++ extension\"><\/p>\n\n\n\n<p>    3\u3001\u5b89\u88c5gcc\uff0cgdb<\/p>\n\n\n\n<p><br>VScode\u53ea\u80fd\u7528\u6765\u7f16\u8f91\u4ee3\u7801\uff0c\u7f16\u8bd1\u8fd0\u884c\u8fd8\u662f\u8981\u7528g++,debug\u8981\u7528gdb<\/p>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\u6765\u5224\u65ad\u662f\u4e0d\u662f\u5b89\u88c5\u4e86gcc\uff0c\u67e5\u770bgcc\u7684\u7248\u672c<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngcc -v\n<\/pre><\/div>\n\n\n<p>\u6ca1\u88c5\u7684\u8bdd\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u88c5\u4e00\u4e0b<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get update\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get install gcc\n<\/pre><\/div>\n\n\n<p>\u7136\u540e\u5b89\u88c5gdb\u548cbuild-essential<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get install build-essential gdb\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"_create-hello-world\">2\u3001 \u521b\u5efaHello World<\/h3>\n\n\n\n<p>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u521b\u5efaprojects\u76ee\u5f55\uff0chelloworld\u76ee\u5f55<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmkdir projects\ncd projects\nmkdir helloworld\ncd helloworld\ncode .\n<\/pre><\/div>\n\n\n<p><code>code .<\/code>&nbsp;\u547d\u4ee4\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u6253\u5f00vscode\uff0c\u5e76\u4e14\u4f1a\u81ea\u52a8\u521b\u5efa3\u4e2a\u9700\u8981\u7684\u6587\u4ef6\u5939<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>tasks.json<\/code>&nbsp;(compiler build \u8bbe\u7f6e)<\/li><li><code>launch.json<\/code>&nbsp;(debugger \u8bbe\u7f6e)<\/li><li><code>c_cpp_properties.json<\/code>&nbsp;(compiler path and IntelliSense \u8bbe\u7f6e)<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_add-hello-world-source-code-file\">\u521b\u5efahelloworld\u7a0b\u5e8f<\/h3>\n\n\n\n<p><code>\u5728\u6587\u4ef6\u6d4f\u89c8\u91cc\u9762\u70b9\u51fb\u65b0\u5efa\u6587\u4ef6\uff0c\u7136\u540e\u540d\u79f0\u5b9a\u4e3ahelloworld.cpp<\/code>.<\/p>\n\n\n\n<p>\uff08\u5b98\u65b9\u7528\u7684\u662fC++\u7a0b\u5e8f\u6f14\u793a\uff0c\u4e2a\u4eba\u7528\u7684\u662fC\u7a0b\u5e8f\uff0chelloworld.c\uff0c\u6f14\u793a\u4e0a\u6ca1\u4ec0\u4e48\u5927\u533a\u522b\uff0c\u5c31\u4e0d\u6539\u4e86\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/msvc\/new-file-button.png\" alt=\"New File title bar button\"\/><\/figure>\n\n\n\n<p>\u62f7\u8d1d\u4e0b\u9762\u7684\u793a\u4f8b\u7a0b\u5e8f\uff0c\u5230\u521a\u624d\u7684\u6587\u4ef6\u91cc\u9762<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &amp;lt;iostream&gt;\n#include &amp;lt;vector&gt;\n#include &amp;lt;string&gt;\n\nusing namespace std;\n\nint main()\n{\n    vector&amp;lt;string&gt; msg {&quot;Hello&quot;, &quot;C++&quot;, &quot;World&quot;, &quot;from&quot;, &quot;VS Code&quot;, &quot;and the C++ extension!&quot;};\n\n    for (const string&amp;amp; word : msg)\n    {\n        cout &amp;lt;&amp;lt; word &amp;lt;&amp;lt; &quot; &quot;;\n    }\n    cout &amp;lt;&amp;lt; endl;\n}\n<\/pre><\/div>\n\n\n<p>Ctrl+S&nbsp;\u4fdd\u5b58<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/msvc\/file-explorer.png\" alt=\"File Explorer\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_explore-intellisense\">IntelliSense<\/h2>\n\n\n\n<p>\u4f3c\u4e4e\u662fvscode\u7684\u4e00\u4e2a\u6269\u5c55\u4f18\u5316\u5de5\u5177\uff0c\u65b9\u4fbf\u770b\u4ee3\u7801\u7684\uff0c\u4e86\u89e3\u7684\u4e0d\u591a\uff0c\u6709\u5174\u8da3\u7684\u8bdd\u53ef\u4ee5\u770b\u4e00\u4e0b\u5b98\u65b9\u7684\u8bf4\u660e<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/msg-intellisense.png\" alt=\"Statement completion IntelliSense\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_build-helloworldcpp\">Build helloworld.cpp<a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/config-linux#_build-helloworldcpp\">#<\/a><\/h2>\n\n\n\n<p><code>\u7136\u540e\u8981\u521b\u5efa\u4e00\u4e2atasks.json<\/code>\u6765\u544a\u8bc9VS Code\u600e\u4e48build (compile) \u7a0b\u5e8f\uff0c\u4e4b\u540e\u4f1a\u8c03\u7528g++\u6765\u521b\u5efa\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n\n\n\n<p>\u7a0b\u5e8f\u8fd9\u4e2a\u65f6\u5019\u5fc5\u987b\u8981\u5728\u7f16\u8f91\u6846\u91cc\uff0c\u5f85\u4f1a\u4f1a\u8c03\u7528\u7f16\u8f91\u6846\u91cc\u7684\u7a0b\u5e8f\u6765\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n\n\n\n<p>\u83dc\u5355\u680f\u9009\u62e9<strong>Terminal<\/strong>&nbsp;&gt;&nbsp;<strong>Configure Default Build Task<\/strong>\uff0c\u7136\u540e\u9009\u62e9&nbsp;<strong>C\/C++: g++ build active file<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/build-active-file.png\" alt=\"Tasks C++ build dropdown\"\/><\/figure>\n\n\n\n<p>\u7136\u540e\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a&nbsp;<code>tasks.json<\/code>&nbsp;file\u5728<code>.vscode<\/code>&nbsp;\u6587\u4ef6\u5939\u91cc\u9762\uff0c<\/p>\n\n\n\n<p>\u5e94\u8be5\u7c7b\u4f3c\u4e0b\u9762\u7684\u5185\u5bb9<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  &quot;version&quot;: &quot;2.0.0&quot;,\n  &quot;tasks&quot;: &#x5B;\n    {\n      &quot;type&quot;: &quot;shell&quot;,\n      &quot;label&quot;: &quot;g++ build active file&quot;,\n      &quot;command&quot;: &quot;\/usr\/bin\/g++&quot;,\n      &quot;args&quot;: &#x5B;&quot;-g&quot;, &quot;${file}&quot;, &quot;-o&quot;, &quot;${fileDirname}\/${fileBasenameNoExtension}&quot;],\n      &quot;options&quot;: {\n        &quot;cwd&quot;: &quot;\/usr\/bin&quot;\n      },\n      &quot;problemMatcher&quot;: &#x5B;&quot;$gcc&quot;],\n      &quot;group&quot;: {\n        &quot;kind&quot;: &quot;build&quot;,\n        &quot;isDefault&quot;: true\n      }\n    }\n  ]\n}\n<\/pre><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note<\/strong>: <code>tasks.json\u66f4\u591a\u7684\u8bf4\u660e\u5728\u8fd9\u4e2a\u91cc\u9762<\/code>&nbsp;&nbsp;<a href=\"https:\/\/code.visualstudio.com\/docs\/editor\/variables-reference\">variables reference<\/a>.<\/p><\/blockquote>\n\n\n\n<p><code>command<\/code>&nbsp;\u8bbe\u7f6e\u4ec0\u4e48\u7a0b\u5e8f\u6765\u8fd0\u884cbuild; \u8fd9\u91cc\u662f g++. <\/p>\n\n\n\n<p><code>args<\/code>\u786e\u8ba4\u8981\u4f20\u9001\u5230g++\u7684\u53c2\u6570. <\/p>\n\n\n\n<p>\u8fd9\u4e2a\u6587\u4ef6\u5185\u5bb9\u5c31\u662f\u544a\u8bc9g++\u53bb\u62ff\u5230\u6253\u5f00\u7684\u6587\u4ef6 (<code>${file}<\/code>), \u7f16\u8bd1\u5b83, \u7136\u540e\u5728\u5f53\u524d\u76ee\u5f55\u7528\u76f8\u540c\u7684\u540d\u5b57\u521b\u5efa\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6(<code>${fileDirname}<\/code>) \uff0c\u5e76\u4e14\u628a\u540e\u7f00\u53bb\u6389(<code>${fileBasenameNoExtension}<\/code>), <code>\u8fd9\u4e2a\u4f8b\u5b50\u91cc\u9762\u751f\u6210\u7684\u5c31\u662fhelloworld<\/code><\/p>\n\n\n\n<p><code>label<\/code>\u53c2\u6570\u53ef\u4ee5\u968f\u610f\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u5728tasks\u91cc\u9762\u67e5\u770b\u3002<\/p>\n\n\n\n<p><code>isDefault: true<\/code>\u5b9a\u4e49\u4e86\u8fd9\u4e2atask\u53ef\u4ee5\u901a\u8fc7Ctrl+Shift+B\u6765\u76f4\u63a5\u8fdb\u884c\u6267\u884c\uff0c\u65b9\u4fbf\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5373\u4f7f\u8bbe\u6210\u4e86false\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u83dc\u5355\u680f\u7684<strong>Tasks: Run Build Task<\/strong>\u8fdb\u884c\u6267\u884c<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_running-the-build\">build<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li><span style=\"color: initial;\">\u6309Ctrl+Shift+B&nbsp;\u6216\u8005\u70b9\u51fb&nbsp;<\/span><strong style=\"color: initial;\">Terminal<\/strong><span style=\"color: initial;\">\u9009\u62e9<\/span><strong style=\"color: initial;\">Run Build Task<\/strong><span style=\"color: initial;\">\uff0c\u6b63\u5e38\u7684\u8bdd\uff0c\u7ed3\u679c\u5e94\u8be5\u5982\u4e0b\u56fe<\/span><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/wsl-task-in-terminal.png\" alt=\"G++ build output in terminal\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><li>\u7136\u540e\u70b9\u51fb+\u53f7\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684terminal\uff0c\u7136\u540e\u70b9.\/helloworld\u5c31\u53ef\u4ee5\u8fdb\u884c\u6267\u884c<img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/wsl-bash-terminal.png\" alt=\"WSL bash terminal\"><\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_modifying-tasksjson\">\u4fee\u6539tasks.json<\/h3>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539<code>tasks.json<\/code>\u6765\u540c\u65f6build\u591a\u4e2aC++\u6587\u4ef6\u901a\u8fc7\u4f7f\u7528<code>\"${workspaceFolder}\/*.cpp\"<\/code>\u66ff\u6362<code>${file}<\/code>. \u4e5f\u53ef\u4ee5\u4fee\u6539\u8f93\u51fa\u6587\u4ef6\u540d\u6765\u66f4\u6539\u8f93\u51fa\u6587\u4ef6\u7684\u540d\u5b57&nbsp;<code>\"${fileDirname}\/${fileBasenameNoExtension}\"<\/code>&nbsp;(\u6bd4\u5982 &#8216;helloworld.out&#8217;).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_debug-helloworldcpp\">Debug helloworld.cpp<a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/config-linux#_debug-helloworldcpp\">#<\/a><\/h2>\n\n\n\n<p>\u7136\u540e\u8981\u521b\u5efa\u4e00\u4e2a<code>launch.json<\/code>\u6587\u4ef6\u6765\u914d\u7f6eVS Code\u4f7f\u7528GDB\u6765debug\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u901a\u8fc7F5\u5feb\u6377\u952e\u5b9e\u73b0<\/p>\n\n\n\n<p><strong>\u70b9\u51fbRun<\/strong>&nbsp;&gt;&nbsp;<strong>Add Configuration&#8230;<\/strong>&nbsp;\u7136\u540e\u9009\u62e9<strong>C++ (GDB\/LLDB)<\/strong>.<\/p>\n\n\n\n<p>\u5728debug\u914d\u7f6e\u91cc\u9762\u9009\u62e9<strong>g++ build and debug active file<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/build-and-debug-active-file.png\" alt=\"C++ debug configuration dropdown\"\/><\/figure>\n\n\n\n<p>VS Code<code>\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2alaunch.json<\/code>\u7c7b\u4f3c\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u7136\u540e\u4f1abuild\uff0c\u8fd0\u884c&#8217;helloworld&#8217;.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  &quot;version&quot;: &quot;0.2.0&quot;,\n  &quot;configurations&quot;: &#x5B;\n    {\n      &quot;name&quot;: &quot;g++ build and debug active file&quot;,\n      &quot;type&quot;: &quot;cppdbg&quot;,\n      &quot;request&quot;: &quot;launch&quot;,\n      &quot;program&quot;: &quot;${fileDirname}\/${fileBasenameNoExtension}&quot;,\n      &quot;args&quot;: &#x5B;],\n      &quot;stopAtEntry&quot;: false,\n      &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,\n      &quot;environment&quot;: &#x5B;],\n      &quot;externalConsole&quot;: false,\n      &quot;MIMode&quot;: &quot;gdb&quot;,\n      &quot;setupCommands&quot;: &#x5B;\n        {\n          &quot;description&quot;: &quot;Enable pretty-printing for gdb&quot;,\n          &quot;text&quot;: &quot;-enable-pretty-printing&quot;,\n          &quot;ignoreFailures&quot;: true\n        }\n      ],\n      &quot;preLaunchTask&quot;: &quot;g++ build active file&quot;,\n      &quot;miDebuggerPath&quot;: &quot;\/usr\/bin\/gdb&quot;\n    }\n  ]\n}\n<\/pre><\/div>\n\n\n<p><code>program\u5b9a\u4e49\u4e86\u4f60\u8981debug\u7684\u7a0b\u5e8f. \u8fd9\u91cc\u662f\u5b9a\u4e49\u4e86\u6d3b\u52a8\u6587\u4ef6\u7684\u6587\u4ef6\u5939${fileDirname}\u4e0b\u7684<\/code>\u6ca1\u6709\u540e\u7f00\u7684\u6d3b\u52a8\u6587\u4ef6\u540d\u79f0\u7684\u6587\u4ef6<code>${fileBasenameNoExtension}<\/code>, \u5982\u679c<code>helloworld.cpp\u662f\u6d3b\u52a8\u6587\u4ef6\u7684\u8bdd\uff0c\u8fd9\u91cc\u5c31\u662fhelloworld<\/code>.<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b C++ \u63d2\u4ef6 \u4e0d\u4f1a\u5728\u7a0b\u5e8f\u91cc\u9762\u521b\u5efa\u4efb\u4f55\u65ad\u70b9\uff0c\u800c\u4e14<code>stopAtEntry<\/code>\u914d\u7f6e\u6210\u4e86<code>false<\/code>.<\/p>\n\n\n\n<p>\u60f3\u8981\u5728\u5b9a\u4e49\u7684\u4f4d\u7f6e\u8ba9\u7a0b\u5e8f\u505c\u4e0b\u6765\uff0c\u9700\u8981\u5c06<code>stopAtEntry<\/code>\u6539\u6210<code>true<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_start-a-debugging-session\">\u5f00\u59cbdebug<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li><code>\u56de\u5230helloworld.cpp<\/code>\uff0c\u8ba9\u5b83\u7ee7\u7eed\u6210\u4e3a\u6d3b\u52a8\u6587\u4ef6<\/li><li>\u6309F5&nbsp;<strong>\u6216\u8005\u9009\u62e9Run &gt; Start Debugging<\/strong>. <\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5728<strong>\u4e0b\u9762\u7684Debug Output<\/strong>\u91cc\u9762\u4f1a\u6709debug\u4fe1\u606f\u51fa\u73b0\uff0c\u4ee3\u8868\u7740debug\u6b63\u5e38\u8fd0\u884c<\/li><li>\u7f16\u8f91\u5668\u9ad8\u4eae\u7684\u8fd9\u4e00\u884c\u5c31\u662f\u9ed8\u8ba4\u7684\u4e00\u4e2a\u65ad\u70b9<img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/wsl\/wsl-breakpoint-default.png\" alt=\"Initial breakpoint\"><\/li><li>\u5728\u7a0b\u5e8f\u7f16\u8f91\u6846\u4e0a\u9762\u80fd\u770b\u5230\u4e00\u4e2a\u7ba1\u7406\u7a97\u53e3\uff0c\u53ef\u4ee5\u5728\u8fd9\u91cc\u8fdb\u884cdebug\u7684\u4e00\u4e9b\u63a7\u5236<\/li><li><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/cpp\/debug-controls.png\" alt=\"Debugging controls\"><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_step-through-the-code\">\u5728\u7a0b\u5e8f\u91cc\u9762\u8df3\u8f6c<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/code.visualstudio.com\/assets\/docs\/cpp\/cpp\/step-over-button.png\" alt=\"Step over button\"\/><\/figure>\n\n\n\n<p>\u6839\u636e\u5b98\u65b9\u6587\u4ef6\u8fdb\u884c\u7684\u8bf4\u660e\uff0c\u51cf\u53bb\u4e86\u4e00\u90e8\u5206\u4e1c\u897f\uff0c\u4ec5\u4f9b\u53c2\u8003\uff0c\u6709\u95ee\u9898\u7684\u8bdd\u53ef\u4ee5\u8054\u7cfb\u6211\uff0c\u6216\u8005\u76f4\u63a5\u67e5\u770b\u5b98\u65b9\u6587\u6863<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7528Debian 11\uff0c\u8fdb\u884cC\u5b66\u4e60\uff0c\u60f3\u7528VScode\u6765\u914d\u7f6e\u73af\u5883\uff0c\u4f46\u662f\u53d1\u73b0\u6709\u5f88\u591a\u95ee\u9898\u3002 \u6bd4\u5982g++\u627e\u4e0d\u5230\uff0cla [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-957","post","type-post","status-publish","format-standard","hentry","category-linux"],"aioseo_notices":[],"views":291,"_links":{"self":[{"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/posts\/957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=957"}],"version-history":[{"count":1,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":958,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions\/958"}],"wp:attachment":[{"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oceansource.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}