Intel 253668-032US User Manual

Page of 806
16-2 Vol. 3
DEBUGGING, PROFILING BRANCHES AND TIME-STAMP COUNTER
instruction is an alternative way to set code breakpoints. It is especially useful 
when more than four breakpoints are desired, or when breakpoints are being 
placed in the source code.
Last branch recording facilities — Store branch records in the last branch 
record (LBR) stack MSRs for the most recent taken branches, interrupts, and/or 
exceptions in MSRs. A branch record consist of a branch-from and a branch-to 
instruction address. Send branch records out on the system bus as branch trace 
messages (BTMs).
These facilities allow a debugger to be called as a separate task or as a procedure in 
the context of the current program or task. The following conditions can be used to 
invoke the debugger:
Task switch to a specific task.
Execution of the breakpoint instruction.
Execution of any instruction.
Execution of an instruction at a specified address.
Read or write to a specified memory address/range.
Write to a specified memory address/range.
Input from a specified I/O address/range.
Output to a specified I/O address/range.
Attempt to change the contents of a debug register.
16.2 DEBUG 
REGISTERS
Eight debug registers (see Figure 16-1) control the debug operation of the processor. 
These registers can be written to and read using the move to/from debug register 
form of the MOV instruction. A debug register may be the source or destination 
operand for one of these instructions. 
Debug registers are privileged resources; a MOV instruction that accesses these 
registers can only be executed in real-address mode, in SMM or in protected mode at 
a CPL of 0. An attempt to read or write the debug registers from any other privilege 
level generates a general-protection exception (#GP).
The primary function of the debug registers is to set up and monitor from 1 to 4 
breakpoints, numbered 0 though 3. For each breakpoint, the following information 
can be specified:
The linear address where the breakpoint is to occur.
The length of the breakpoint location (1, 2, or 4 bytes).
The operation that must be performed at the address for a debug exception to be 
generated.
Whether the breakpoint is enabled.