{"id":7706,"date":"2019-11-23T20:36:59","date_gmt":"2019-11-23T20:36:59","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=7706"},"modified":"2019-11-24T11:29:37","modified_gmt":"2019-11-24T11:29:37","slug":"debugging-rust-in-visual-code","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/debugging-rust-in-visual-code\/","title":{"rendered":"Debugging Rust in Visual Code"},"content":{"rendered":"<p>I&#8217;m using Visual Code a lot for Rust development, so it&#8217;d be good to be able to debug a Rust application within it. Simply change the settings.json file, i.e. <\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nFile | Preferences | Settings\r\n<\/pre>\n<p>from the <em>settings.json<\/em> and now add<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n&quot;debug.allowBreakpointsEverywhere&quot;: true,\r\n<\/pre>\n<p>Now add the C\/C++ Microsoft extension if you&#8217;ve not already added it to Visual Code.<\/p>\n<p>Next up, select<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nDebug | Add Configuration...\r\n<\/pre>\n<p>and the option<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nC++ (Windows)\r\n<\/pre>\n<p>Here&#8217;s my resultant launch.json file<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n{\r\n  &quot;version&quot;: &quot;0.2.0&quot;,\r\n  &quot;configurations&quot;: &#x5B;\r\n    {\r\n      &quot;name&quot;: &quot;(Windows) Launch&quot;,\r\n      &quot;type&quot;: &quot;cppvsdbg&quot;,\r\n      &quot;request&quot;: &quot;launch&quot;,\r\n      &quot;program&quot;: &quot;${workspaceFolder}\/target\/debug\/test.exe&quot;,\r\n      &quot;args&quot;: &#x5B;],\r\n      &quot;stopAtEntry&quot;: false,\r\n      &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,\r\n      &quot;environment&quot;: &#x5B;],\r\n      &quot;externalConsole&quot;: false\r\n    }\r\n  ]\r\n}\r\n<\/pre>\n<p>and that&#8217;s it, now add a break point to your application, select Debug | Start Debugging (F5) and you&#8217;re off and running in the debugger.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using Visual Code a lot for Rust development, so it&#8217;d be good to be able to debug a Rust application within it. Simply change the settings.json file, i.e. File | Preferences | Settings from the settings.json and now add &quot;debug.allowBreakpointsEverywhere&quot;: true, Now add the C\/C++ Microsoft extension if you&#8217;ve not already added it to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[191,246],"tags":[],"class_list":["post-7706","post","type-post","status-publish","format-standard","hentry","category-rust","category-visual-code"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=7706"}],"version-history":[{"count":5,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7706\/revisions"}],"predecessor-version":[{"id":7735,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/7706\/revisions\/7735"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=7706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=7706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=7706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}