{"id":41,"date":"2007-05-14T06:40:55","date_gmt":"2007-05-14T11:40:55","guid":{"rendered":"http:\/\/mariusbancila.ro\/blog\/?p=41"},"modified":"2013-08-13T09:53:57","modified_gmt":"2013-08-13T07:53:57","slug":"debugging-and-exception-handling","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/","title":{"rendered":"Debugging and Exception Handling"},"content":{"rendered":"<p>Suppose you have the following code:<\/p>\n<pre class=\"cpp\" name=\"code\">\r\nvoid foo() \r\n{ \r\n  throw std::runtime_error(\"a foo exception!\"); \r\n}  \r\n\r\nint main() \r\n{ \r\n  foo(); \r\n}<\/pre>\n<p>When running the program, the following window is popped up:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" align=\"middle\" width=\"446\" src=\"\/blog\/\/wp-content\/uploads\/2007\/05\/exception1.png\" height=\"224\" style=\"width: 446px; height: 224px\" \/><br \/>\nWhen running it in the debugger, a different window is popped up:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" align=\"middle\" width=\"444\" src=\"\/blog\/\/wp-content\/uploads\/2007\/05\/exception2.png\" height=\"204\" style=\"width: 444px; height: 204px\" \/><br \/>\nand the debugger takes you to the line of code that threw the exception. Looking into the output window, you can see something like this:<\/p>\n<blockquote><p>\nFirst-chance exception at 0x7c812a5b in win32test.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0012fd70..<br \/>\nUnhandled exception at 0x7c812a5b in win32test.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0012fd70..<\/p><\/blockquote>\n<p>It shows a first-chance and an unhandle (also knows as second-chance) exception message. When running a program in debugger, the debugger always sees the exception before the program does. Thus, it is said that the debugger gets a first chance to handle the exception. If it does not do that, and the execution continues, the program will see the exception and has a chance to handle it. If the exception is not handled by the program, the debugger gets a second-chance to see the unhandled exception. This is the point when in the absense of the debugger, the program crashes.<\/p>\n<p>So, what happened with the program above: the debugger saw an exception and printed the first-chance exception message, but did not handle it, and the program was allowed to continue. However, the program did not handle the exception either, and the debugger got its second-chance with the unhandled-exception; the unhandle exception messages was printed and the exception windows was popped.<\/p>\n<p>Of course, you could change to code in function main to this:<\/p>\n<pre class=\"cpp\" name=\"code\">\r\nint main() \r\n{ \r\n   try { \r\n      foo(); \r\n   } \r\n   catch(...) { \r\n   } \r\n}<\/pre>\n<p>In this case when run, the program will not crash. But when running in the debugger, you will see the first-chance exception message:<\/p>\n<blockquote><p>\nFirst-chance exception at 0x7c812a5b in win32test.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0012fd5c..<\/p><\/blockquote>\n<p>In this case, the program handled the exception (by doing nothing) and the debugger did not get the second-chance.<\/p>\n<p>Now, suppose your program is much langer than the several lines of code shown above. When running in the debugger you see first-chance exception messages, but not the second-chance exception message, because your program handles the exception. Should you investigate the cause of the exception, problems arise simply because you don&#8217;t know where the exception was thrown. The good news is that you can customize the debugger to break on first-chance exception.<\/p>\n<p>From the Debug menu, use the Exceptions command to open the dialog that allows you to specify on which exception should the debugger break.<\/p>\n<p><img decoding=\"async\" align=\"middle\" src=\"\/blog\/\/wp-content\/uploads\/2007\/05\/exception3.png\" \/><\/p>\n<p>There are several categories:<\/p>\n<ul>\n<li>C++ exceptions<\/li>\n<li>Common Language Runtime Exceptions<\/li>\n<li>Managed Debugging Assistants<\/li>\n<li>Native Run-Time Checks<\/li>\n<li>Win32 Exceptions<\/li>\n<\/ul>\n<p>By default, none of the C++ exceptions is checked. That means if you check std::exception (as shown in the picture), the debugger should stop when and exception of a type derived from std::exception is thrown. (To verify that run the code aboe in the debugger again.)<\/p>\n<p>What if std::runtime_exception was replaced with a custom exception, foo_exception?<\/p>\n<pre class=\"cpp\" name=\"code\">\r\nclass foo_exception \r\n{ \r\n  std::string Message; \r\npublic: \r\n  foo_exception(const std::string&amp; message): \r\n    Message(message) \r\n  { \r\n  }  \r\n\r\n  std::string GetMessage() const {return Message;} \r\n}; \r\n\r\nvoid foo() \r\n{ \r\n  throw foo_exception(\"a foo exception!\"); \r\n}  \r\n\r\nint _tmain(int argc, _TCHAR* argv[]) \r\n{ \r\n  try { \r\n     foo(); \r\n  } \r\n  catch(...) { \r\n  }  \r\n\r\n  return 0; \r\n}<\/pre>\n<p>Of course, the debugger would not stop when having the first-exception to handle it, because foo_exception is not in its list. You can however, change than by adding foo_exception to the list from the Exceptions dialog (as shown below) and check it for breaking on first-chance.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" align=\"middle\" width=\"471\" src=\"\/blog\/\/wp-content\/uploads\/2007\/05\/exception4.png\" height=\"141\" style=\"width: 471px; height: 141px\" \/><\/p>\n<p>Running again would stop the debugger when foo_exception is thrown.<\/p>\n<p><img decoding=\"async\" align=\"middle\" src=\"\/blog\/\/wp-content\/uploads\/2007\/05\/exception5.png\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suppose you have the following code: void foo() { throw std::runtime_error(&#8220;a foo exception!&#8221;); } int main() { foo(); } When running the program, the following window is popped up: When running it in the debugger, a different window is popped up: and the debugger takes you to the line of code that threw the exception. &#8230; <a title=\"Debugging and Exception Handling\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/\" aria-label=\"Read more about Debugging and Exception Handling\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[7,10],"tags":[451,35,55],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-c","category-visual-studio","tag-c","tag-debugger","tag-visualstudio"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,debugger,visualstudio\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Debugging and Exception Handling\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2007-05-14T11:40:55+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-08-13T07:53:57+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Debugging and Exception Handling\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#article\",\"name\":\"Debugging and Exception Handling\",\"headline\":\"Debugging and Exception Handling\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/\\\/wp-content\\\/uploads\\\/2007\\\/05\\\/exception1.png\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#articleImage\"},\"datePublished\":\"2007-05-14T06:40:55+02:00\",\"dateModified\":\"2013-08-13T09:53:57+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#webpage\"},\"articleSection\":\"C++, Visual Studio, C++, debugger, VisualStudio\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"position\":4,\"name\":\"C++\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#listItem\",\"name\":\"Debugging and Exception Handling\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#listItem\",\"position\":5,\"name\":\"Debugging and Exception Handling\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/\",\"name\":\"Debugging and Exception Handling\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2007\\\/05\\\/14\\\/debugging-and-exception-handling\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2007-05-14T06:40:55+02:00\",\"dateModified\":\"2013-08-13T09:53:57+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Debugging and Exception Handling","description":"","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/","robots":"max-image-preview:large","keywords":"c++,debugger,visualstudio","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#article","name":"Debugging and Exception Handling","headline":"Debugging and Exception Handling","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/\/wp-content\/uploads\/2007\/05\/exception1.png","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#articleImage"},"datePublished":"2007-05-14T06:40:55+02:00","dateModified":"2013-08-13T09:53:57+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#webpage"},"articleSection":"C++, Visual Studio, C++, debugger, VisualStudio"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","position":4,"name":"C++","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#listItem","name":"Debugging and Exception Handling"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#listItem","position":5,"name":"Debugging and Exception Handling","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/","name":"Debugging and Exception Handling","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2007-05-14T06:40:55+02:00","dateModified":"2013-08-13T09:53:57+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"Debugging and Exception Handling","og:url":"https:\/\/mariusbancila.ro\/blog\/2007\/05\/14\/debugging-and-exception-handling\/","article:published_time":"2007-05-14T11:40:55+00:00","article:modified_time":"2013-08-13T07:53:57+00:00","twitter:card":"summary","twitter:title":"Debugging and Exception Handling"},"aioseo_meta_data":{"post_id":"41","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:04:51","updated":"2025-12-12 07:11:10","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":2,"uagb_excerpt":"Suppose you have the following code: void foo() { throw std::runtime_error(\"a foo exception!\"); } int main() { foo(); } When running the program, the following window is popped up: When running it in the debugger, a different window is popped up: and the debugger takes you to the line of code that threw the exception.&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">Visual Studio<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">Visual Studio<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">debugger<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/visual-studio\/\" class=\"advgb-post-tax-term\">VisualStudio<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">debugger<\/span>","<span class=\"advgb-post-tax-term\">VisualStudio<\/span>"]}},"comment_count":"2","relative_dates":{"created":"Posted 19 years ago","modified":"Updated 13 years ago"},"absolute_dates":{"created":"Posted on May 14, 2007","modified":"Updated on August 13, 2013"},"absolute_dates_time":{"created":"Posted on May 14, 2007 6:40 am","modified":"Updated on August 13, 2013 9:53 am"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-F","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":2,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":1622,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions\/1622"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}