ntdll: Fix up instruction pointer in context inside raise_exception.

This commit is contained in:
Peter Oberndorfer 2007-05-22 18:28:53 +02:00 committed by Alexandre Julliard
parent 30cc21196e
commit eab168cf9e
2 changed files with 6 additions and 9 deletions

View File

@ -336,6 +336,11 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
return STATUS_SUCCESS;
#ifdef __i386__
/* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */
if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Eip--;
#endif
if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION)
return STATUS_SUCCESS;

View File

@ -215,11 +215,9 @@ LONG CALLBACK rtlraiseexception_vectored_handler(EXCEPTION_POINTERS *ExceptionIn
*/
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
{
todo_wine {
ok(context->Eip == (DWORD)code_mem + 0xa, "Eip at %x instead of %x\n",
context->Eip, (DWORD)code_mem + 0xa);
}
}
else
{
ok(context->Eip == (DWORD)code_mem + 0xb, "Eip at %x instead of %x\n",
@ -247,11 +245,9 @@ static DWORD rtlraiseexception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR
*/
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
{
todo_wine {
ok(context->Eip == (DWORD)code_mem + 0xa, "Eip at %x instead of %x\n",
context->Eip, (DWORD)code_mem + 0xa);
}
}
else
{
ok(context->Eip == (DWORD)code_mem + 0xb, "Eip at %x instead of %x\n",
@ -525,9 +521,7 @@ static DWORD int3_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD
{
ok( rec->ExceptionAddress == code_mem, "exception address not at: %p, but at %p\n",
code_mem, rec->ExceptionAddress);
todo_wine {
ok( context->Eip == (DWORD)code_mem, "eip not at: %p, but at %#x\n", code_mem, context->Eip);
}
if(context->Eip == (DWORD)code_mem) context->Eip++; /* skip breakpoint */
return ExceptionContinueExecution;
@ -692,10 +686,8 @@ static void test_debugger(void)
/* ctx.Eip is the same value the exception handler got */
if (de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
{
todo_wine{
ok((char *)ctx.Eip == (char *)code_mem_address + 0xa, "Eip at 0x%x instead of %p\n",
ctx.Eip, (char *)code_mem_address + 0xa);
}
/* need to fixup Eip for debuggee */
if ((char *)ctx.Eip == (char *)code_mem_address + 0xa)
ctx.Eip += 1;