Roland Pihlakas
Roland Pihlakas

Reputation: 4573

WinDbg: Execute an external application every time a breakpoint is hit

Is there a way to run some external application every time a breakpoint is hit in WinDbg?

I have multiple virtual machines running in different host machines and I would like to get notified when one of them has hit a breakpoint. It would be distracting to shuffle every now and then between the RDP windows just to check whether some WinDbg has now stumbled upon some breakpoint.

I know already that it is possible for WinDbg to flash the title bar or play a sound when a breakpoint is hit.

Currently I imagine I could use a script to observe the tail of the log file, and start the external application when some appropriate pattern is added to the log file. But WinDbg-based solution would be better.

Upvotes: 3

Views: 492

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59259

The syntax for setting a breakpoint is

[~Thread] bp[ID] [Options] [Address [Passes]] ["CommandString"] 

The key thing here is CommandString, which (according online help)

Specifies a list of commands that are executed

Use that together with .shell to run an external program

Upvotes: 6

Related Questions