Hi!
How could I handle Exc1 (fired when EIP equals to DRn and debug feature is enabled in DR7)?
I mean the cs:eip in the stack is the one pointed by DRn. So if I'd like to continue the execution, I should disable DRn. But I don't want to. Any ideas?
Thanks,
Handling debug exception
Re: Handling debug exception
Take a look at this flag in EFLAGS.
RF Resume (bit 16) — Controls the processor’s response to instruction-breakpoint conditions. When set, this flag temporarily disables debug exceptions (#DB) from being generated for instruction breakpoints (although other exception conditions can cause an exception to be generated). When clear, instruction breakpoints will generate debug exceptions.
The primary function of the RF flag is to allow the restarting of an instruction following a debug exception that was caused by an instruction breakpoint condition. Here, debug software must set this flag in the EFLAGS image on the stack just prior to returning to the interrupted program with IRETD (to prevent the instruction breakpoint from causing another debug exception). The processor then automatically clears this flag after the instruction returned to has been successfully executed, enabling instruction breakpoint faults again.
See also: Section 17.3.1.1, “Instruction-Breakpoint Exception Condition.”
Re: Handling debug exception
A couple of ywars ago I've read about this, but totally forgot it. Thanks for the answer, it was a huge help.quirck wrote:Take a look at this flag in EFLAGS.
RF Resume (bit 16) — Controls the ...
See also: Section 17.3.1.1