{"id":2338,"date":"2019-02-03T09:47:52","date_gmt":"2019-02-03T14:47:52","guid":{"rendered":"https:\/\/bitpost.com\/news\/?p=2338"},"modified":"2019-09-28T18:39:17","modified_gmt":"2019-09-28T23:39:17","slug":"print-long-c-strings-with-gdb-in-visual-studio-code","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2019\/print-long-c-strings-with-gdb-in-visual-studio-code\/","title":{"rendered":"Print long C++ strings with gdb in Visual Studio Code"},"content":{"rendered":"\n<p>While debugging, you can use the Debug Console to print memory, including the content of strings that are clipped by default in the variables and watch windows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>View > Open View > Debug Console<\/code><\/pre>\n\n\n\n<p>From there, send gdb a command to print memory &#8211; 300 characters of a string in this example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-exec x\/300sb Query.c_str()<\/code><\/pre>\n\n\n\n<p>Make sure you use a char*, not a string object &#8211; if it&#8217;s a string, just tack on .c_str().<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While debugging, you can use the Debug Console to print memory, including the content of strings that are clipped by default in the variables and watch windows. From there, send gdb a command to print memory &#8211; 300 characters of a string in this example: Make sure you use a char*, not a string object [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[22],"tags":[],"class_list":["post-2338","post","type-post","status-publish","format-standard","hentry","category-cpp"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-BI","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=2338"}],"version-history":[{"count":2,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2338\/revisions"}],"predecessor-version":[{"id":2371,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2338\/revisions\/2371"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=2338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=2338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=2338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}