{"id":109607,"date":"2024-04-03T07:00:00","date_gmt":"2024-04-03T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=109607"},"modified":"2024-04-04T10:09:43","modified_gmt":"2024-04-04T17:09:43","slug":"20240403-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20240403-00\/?p=109607","title":{"rendered":"Windows debugger trick: Breaking when a specific debugger message is printed"},"content":{"rendered":"<p>In the Windows debugging engine, <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/debugger\/sx--sxd--sxe--sxi--sxn--sxr--sx---set-exceptions-\"> the <tt>sx<\/tt> command<\/a> configures many of the conditions under which the debugger will break. To enable a break condition, you say <tt>sxe<a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/debugger\/controlling-exceptions-and-events\"><span style=\"border: solid 1px currentcolor;\">cond<\/span><\/a><\/tt>, and the corresponding <tt>sxd<\/tt>\u00a0to disable it. For example, a common command is to ask for the debugger to break when a specific DLL is loaded by saying <tt>sxeld contoso.dll<\/tt>.<\/p>\n<p>To break when a specific string is printed to the debugger, you can say <tt>sxe out:<span style=\"border: solid 1px currentcolor;\">str<\/span><\/tt>. For example, <tt>sxe out:*assertion failure*<\/tt> will break whenever any message contains the phrase &#8220;assertion failure&#8221;. <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/debugger\/string-wildcard-syntax\"> Here&#8217;s the wildcard syntax<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A different kind of conditional breakpoint.<\/p>\n","protected":false},"author":1069,"featured_media":100998,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-109607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A different kind of conditional breakpoint.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/109607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=109607"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/109607\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/100998"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=109607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=109607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=109607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}