{"id":170,"date":"2023-09-02T19:25:41","date_gmt":"2023-09-03T00:25:41","guid":{"rendered":"https:\/\/aflyonthewall.page\/?p=170"},"modified":"2025-11-11T20:32:16","modified_gmt":"2025-11-12T02:32:16","slug":"c-debugging-in-eclipse-cdt-on-linux","status":"publish","type":"post","link":"https:\/\/aflyonthewall.page\/index.php\/2023\/09\/02\/c-debugging-in-eclipse-cdt-on-linux\/","title":{"rendered":"C++ Debugging in Eclipse CDT on Linux"},"content":{"rendered":"\n<p>This post is a reminder to myself, and maybe help others, how I managed to get Eclipse CDT to work meaningfully with gdb for debugging.<\/p>\n\n\n\n<p>Eclipse &#8211; in its default state with CDT &#8211; often there is not visibility into vectors and more complicated containers when you&#8217;re debugging. You get to see the vectors, with an error that the Internet says &#8220;is as designed&#8221;. (In a future update, I&#8217;ll include the error. But for now, I&#8217;m just happy with a solution.)<\/p>\n\n\n\n<p>I think this is due to missing flags (-g3) when compiling. Sorting this out is less important that finishing my college courses though.<\/p>\n\n\n\n<p><strong>The issue seems to be in how you create the C++ project in Eclipse.<\/strong><\/p>\n\n\n\n<p>To make it work:<\/p>\n\n\n\n<p>(1) In Eclipse, in the Project Explorer, right-click in a blank area, and select New -&gt; Project. <strong>(Not C\/C++ Project!)<\/strong><\/p>\n\n\n\n<p>(2) In the &#8220;Select a wizard&#8221; prompt, In the C\/C++ folder, select &#8220;C++ Project&#8221;.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"298\" src=\"https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image.png\" alt=\"\" class=\"wp-image-171\" srcset=\"https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image.png 519w, https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image-300x172.png 300w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>(3) In the next dialog, select Linux GCC as your toolchain. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"517\" height=\"254\" src=\"https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image-1.png\" alt=\"\" class=\"wp-image-172\" srcset=\"https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image-1.png 517w, https:\/\/aflyonthewall.page\/wp-content\/uploads\/2023\/09\/image-1-300x147.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Add new cpp source files, or edit the Hello World it gives you, build the project, and debug it, now meaningfully.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is a reminder to myself, and maybe help others, how I managed to get Eclipse CDT to work meaningfully with gdb for debugging. Eclipse &#8211; in its default state with CDT &#8211; often there is not visibility into vectors and more complicated containers when you&#8217;re debugging. You get to see the vectors, with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":5,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/posts\/170\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aflyonthewall.page\/index.php\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}