Windows debugger trick: Breaking when a specific debugger message is printed

Raymond Chen

In the Windows debugging engine, the sx command configures many of the conditions under which the debugger will break. To enable a break condition, you say sxecond, and the corresponding sxd to disable it. For example, a common command is to ask for the debugger to break when a specific DLL is loaded by saying sxeld contoso.dll.

To break when a specific string is printed to the debugger, you can say sxe out:str. For example, sxe out:*assertion failure* will break whenever any message contains the phrase “assertion failure”. Here’s the wildcard syntax.

2 comments

Leave a comment

  • Shawn Van Ness 1

    Did you mean sxd not sdx? (muscle-memory / habit? 🙂

    More windbg / kdb advanced tips and tricks please .. it could be a whole series.

    There are some “windbg cheatsheets” but not much else out there, that I can find.

Feedback usabilla icon