Re: Why do Intel's processors provide four debug registers rather than only one?



Read the Intel docs. Also read how to use the debug registers in Windbg or
another good debugger. This is basic level question and four are frequently
not enough.

"Lighter" <cqulyx@xxxxxxxxx> wrote in message
news:1159069682.508668.73190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Why do Intel's processors provide four debug registers rather than only
one?

As we know, there are four debug registers (DR0 through DR3) inside
every Intel's processor except for the very early ones. What makes me
confused is as follows:

To my thinking, one debug regiter is enough to set a breakpoint for a
runnning program. If we need to set more breakpoints for this program,
we can do this job in the service routine of the debug interrupt. For
example, assuming we want to set two breakpoints at address 5 and 7. To
this end, we can first set DR0 to addess 5, when the program attempts
to executes the instruction at address 5, a debug interrupt will be
triggered and the ISR we provided in advance will be called. In the
ISR, we can set D0 to address 7 and return. Thus, the program will be
interrupted again when it attempts to execute the instruction at
address 7.

Following the steps I describe above seems a good solution to debugging
all kinds of programs. Why does the processor provide four ones? I
cannot think out how much we can benefit from providing more than one
debug register.

Any explanation will be appreciated. Thanks in advance.



.



Relevant Pages

  • Re: Why do Intels processors provide four debug registers rather than only one?
    ... I/O breakpoints, but even in the case of execution breakpoints, DR0-3 ... there are four debug registers inside ... we can do this job in the service routine of the debug interrupt. ...
    (comp.lang.asm.x86)
  • Re: GetThreadContext and debug register problem
    ... A decent app should not care about debugger. ... debugger could go into debug mode is setting debug registers and ... originally used the kernel debug to trigger the debug registers as I ... CONTEXT structure, and then pass it to SetThreadContext. ...
    (microsoft.public.win32.programmer.kernel)
  • Why do Intels processors provide four debug registers rather than only one?
    ... Why do Intel's processors provide four debug registers rather than only ... there are four debug registers (DR0 through DR3) inside ... we can do this job in the service routine of the debug interrupt. ... assuming we want to set two breakpoints at address 5 and 7. ...
    (comp.lang.asm.x86)
  • Why do Intels processors provide four debug registers rather than only one?
    ... Why do Intel's processors provide four debug registers rather than only ... there are four debug registers (DR0 through DR3) inside ... we can do this job in the service routine of the debug interrupt. ... assuming we want to set two breakpoints at address 5 and 7. ...
    (microsoft.public.development.device.drivers)
  • Why do Intels processors provide four debug registers rather than only one?
    ... Why do Intel's processors provide four debug registers rather than only ... there are four debug registers (DR0 through DR3) inside ... we can do this job in the service routine of the debug interrupt. ... assuming we want to set two breakpoints at address 5 and 7. ...
    (microsoft.public.win32.programmer.kernel)

Loading