{"id":5266,"date":"2014-03-30T20:04:13","date_gmt":"2014-03-30T20:04:13","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/put-code-executed-by-gdb-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:04:13","modified_gmt":"2014-03-30T20:04:13","slug":"put-code-executed-by-gdb-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/put-code-executed-by-gdb-collection-of-common-programming-errors\/","title":{"rendered":"put code executed by GDB-Collection of common programming errors"},"content":{"rendered":"<p>I have small question. Is it possible in C\/C++ to put bit of codes that would interact a bit more with GDB ?<\/p>\n<p>Let say I have a function like<\/p>\n<pre><code>void gdb_print(const char*);\n<\/code><\/pre>\n<p>This would print information in gdb while it executes! If it&#8217;s not possible it would be awesome. Would be simple to track some information, and faster in some way!<\/p>\n<p>I need something like this, because we&#8217;re writing some plugins, and info from cout or cerr are not going to the console at all. So it would be something discrete. Also, could add some stuff like:<\/p>\n<pre><code>#ifdef __DEBUG__\n  #define debug_msg(x) gdb_print(x)\n#else\n  #define debug_msg(x)\n#endif\n<\/code><\/pre>\n<p>If it doesn&#8217;t exist, let me know what you think about this!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have small question. Is it possible in C\/C++ to put bit of codes that would interact a bit more with GDB ? Let say I have a function like void gdb_print(const char*); This would print information in gdb while it executes! If it&#8217;s not possible it would be awesome. Would be simple to track [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5266","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5266"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5266\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}