br (Breakpoint Register)

br [number] flags [addr] [count] ["cmds"]
 

The Pentium processor contains four "hardware debug registers" that support hardware address breakpoints. Hardware debug registers allow the user to instruct the processor hardware to interrupt processor execution when specified addresses are read, written or executed. This is a very useful tool, for example, to find out what procedures are accessing or changing a specified memory variable.

The br command sets a Pentium debug register breakpoint, in order to "break" on data reads, writes and instruction execution. Up to four debug registers can be set and enabled at one time.

Hardware breakpoints take precedence over faults.

Since the four debug registers are global to the system, they should typically only be touched by a kernel mode debugger. See Knowledge Base Article Q137199, " PRB: Debuggers Cannot Reliably Use Debug Register Breakpoints" for more information.

See also the following MSDN Library CD article: Q105275, "Using the 'BR' Command in WDEB386.EXE".

number
Specifies which breakpoint is being created. No space is allowed between the br command and the number parameter. If number is omitted, the first available breakpoint number is used.
flags
Specifies the length and break conditions for the breakpoint. This parameter can be some combination of the following values:
1 Set 1-byte length (default value).
2 Set word length on word boundary.
4 Set doubleword length on doubleword boundary.
E Break on instruction execution only (1-byte length only).
W Break on writes only.
R Break on reads and writes.

addr
Specifies the address to be watched.
count
Specifies the number of times the breakpoint is to be ignored before being executed. It can be any 16-bit value.
cmds
Specifies an optional list of debugger commands to be executed in place of the default command when the breakpoint is reached. You must enclose the group of optional commands in quotation marks and separate optional commands with semicolons (;).