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.


Discussion is closed. Login to edit/delete existing comments.

  • Shawn Van Ness 2

    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.

    • Raymond ChenMicrosoft employee 0

      Oops, fixed. Thanks.

Feedback usabilla icon