Setting Dynamic Breakpoints in WinDbgLast reviewed: November 2, 1995Article ID: Q100642 |
The information in this article applies to:
SUMMARYThe WinDbg breakpoint command contains a metacircular interpreter; that is, you can execute commands dynamically once a breakpoint is hit. This allows you to perform complex operations, including breaking when an automatic variable has changed, as described below. The command interpreter of WinDbg allows any valid C expression to serve as a break condition. For example, to break whenever a static variable has changed, use the following expression in the Expression field of the breakpoint dialog box:
&<variablename>In addition, the length should be specified as 4 (the size of a DWORD) in the length field. This technique does not work for automatic variables because the address of an automatic variable may change depending on the value that the stack pointer has upon entering the function that defines the automatic variable. This is one case where the breakpoint needs to be redefined dynamically. For this purpose, a breakpoint can be enabled at function start and disabled at function exit, so that the address of the variable is recomputed.
MORE INFORMATIONSuppose that the name of the function is "subroutine" and the local variable name is "i". The following steps will be used:
|
Additional reference words: 3.10 3.50 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |