ntdll: Fix single stepping over popf instruction.
This commit is contained in:
parent
696eddca8c
commit
6f88a7b7d4
@ -1019,11 +1019,15 @@ static void WINAPI raise_trap_exception( EXCEPTION_RECORD *rec, CONTEXT *context
|
|||||||
{
|
{
|
||||||
context->ContextFlags = CONTEXT_DEBUG_REGISTERS;
|
context->ContextFlags = CONTEXT_DEBUG_REGISTERS;
|
||||||
NtGetContextThread(GetCurrentThread(), context);
|
NtGetContextThread(GetCurrentThread(), context);
|
||||||
/* do we really have a bp from a debug register ?
|
/* we have either:
|
||||||
* if not, then someone did a kill(SIGTRAP) on us, and we
|
* - a bp from a debug register
|
||||||
* shall return a breakpoint, not a single step exception
|
* - a single step interrupt at popf instruction, which just has
|
||||||
|
* removed the TF.
|
||||||
|
* - someone did a kill(SIGTRAP) on us, and we shall return
|
||||||
|
* a breakpoint, not a single step exception
|
||||||
*/
|
*/
|
||||||
if (!(context->Dr6 & 0xf)) rec->ExceptionCode = EXCEPTION_BREAKPOINT;
|
if ( !(context->Dr6 & 0xf) && !(context->Dr6 & 0x4000) )
|
||||||
|
rec->ExceptionCode = EXCEPTION_BREAKPOINT;
|
||||||
context->ContextFlags |= CONTEXT_FULL; /* restore flags */
|
context->ContextFlags |= CONTEXT_FULL; /* restore flags */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,8 +265,8 @@ static DWORD single_step_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_
|
|||||||
else {
|
else {
|
||||||
/* show that the last single step exception on the popf instruction
|
/* show that the last single step exception on the popf instruction
|
||||||
* (which removed the TF bit), still is a EXCEPTION_SINGLE_STEP exception */
|
* (which removed the TF bit), still is a EXCEPTION_SINGLE_STEP exception */
|
||||||
todo_wine { ok( rec->ExceptionCode == EXCEPTION_SINGLE_STEP,
|
ok( rec->ExceptionCode == EXCEPTION_SINGLE_STEP,
|
||||||
"exception is not EXCEPTION_SINGLE_STEP: %x\n", rec->ExceptionCode); };
|
"exception is not EXCEPTION_SINGLE_STEP: %x\n", rec->ExceptionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExceptionContinueExecution;
|
return ExceptionContinueExecution;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user