ntdll/tests: Fix w2008 debugger test results.
Changing Eip has an effect there, so offset it just a little bit so that it still falls within code. Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
03e9de4920
commit
f804d1ac70
|
@ -376,14 +376,16 @@ static LONG CALLBACK rtlraiseexception_vectored_handler(EXCEPTION_POINTERS *Exce
|
||||||
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
|
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
|
||||||
{
|
{
|
||||||
ok(context->Eip == (DWORD)code_mem + 0xa ||
|
ok(context->Eip == (DWORD)code_mem + 0xa ||
|
||||||
broken(context->Eip == (DWORD)code_mem + 0xb), /* win2k3 */
|
broken(context->Eip == (DWORD)code_mem + 0xb) /* win2k3 */ ||
|
||||||
|
broken(context->Eip == (DWORD)code_mem + 0xd) /* w2008 */,
|
||||||
"Eip at %x instead of %x or %x\n", context->Eip,
|
"Eip at %x instead of %x or %x\n", context->Eip,
|
||||||
(DWORD)code_mem + 0xa, (DWORD)code_mem + 0xb);
|
(DWORD)code_mem + 0xa, (DWORD)code_mem + 0xb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ok(context->Eip == (DWORD)code_mem + 0xb, "Eip at %x instead of %x\n",
|
ok(context->Eip == (DWORD)code_mem + 0xb ||
|
||||||
context->Eip, (DWORD)code_mem + 0xb);
|
broken(context->Eip == (DWORD)code_mem + 0xd) /* w2008 */,
|
||||||
|
"Eip at %x instead of %x\n", context->Eip, (DWORD)code_mem + 0xb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test if context change is preserved from vectored handler to stack handlers */
|
/* test if context change is preserved from vectored handler to stack handlers */
|
||||||
|
@ -411,14 +413,16 @@ static DWORD rtlraiseexception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR
|
||||||
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
|
if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
|
||||||
{
|
{
|
||||||
ok(context->Eip == (DWORD)code_mem + 0xa ||
|
ok(context->Eip == (DWORD)code_mem + 0xa ||
|
||||||
broken(context->Eip == (DWORD)code_mem + 0xb), /* win2k3 */
|
broken(context->Eip == (DWORD)code_mem + 0xb) /* win2k3 */ ||
|
||||||
|
broken(context->Eip == (DWORD)code_mem + 0xd) /* w2008 */,
|
||||||
"Eip at %x instead of %x or %x\n", context->Eip,
|
"Eip at %x instead of %x or %x\n", context->Eip,
|
||||||
(DWORD)code_mem + 0xa, (DWORD)code_mem + 0xb);
|
(DWORD)code_mem + 0xa, (DWORD)code_mem + 0xb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ok(context->Eip == (DWORD)code_mem + 0xb, "Eip at %x instead of %x\n",
|
ok(context->Eip == (DWORD)code_mem + 0xb ||
|
||||||
context->Eip, (DWORD)code_mem + 0xb);
|
broken(context->Eip == (DWORD)code_mem + 0xd) /* w2008 */,
|
||||||
|
"Eip at %x instead of %x\n", context->Eip, (DWORD)code_mem + 0xb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(have_vectored_api)
|
if(have_vectored_api)
|
||||||
|
@ -1045,8 +1049,8 @@ static void test_debugger(void)
|
||||||
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb, "Eip at %x instead of %p\n",
|
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb, "Eip at %x instead of %p\n",
|
||||||
ctx.Eip, (char *)code_mem_address + 0xb);
|
ctx.Eip, (char *)code_mem_address + 0xb);
|
||||||
/* setting the context from debugger does not affect the context that the
|
/* setting the context from debugger does not affect the context that the
|
||||||
* exception handler gets */
|
* exception handler gets, except on w2008 */
|
||||||
ctx.Eip = 0x12345;
|
ctx.Eip = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.Eax = 0xf00f00f1;
|
ctx.Eax = 0xf00f00f1;
|
||||||
/* let the debuggee handle the exception */
|
/* let the debuggee handle the exception */
|
||||||
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||||
|
@ -1058,7 +1062,7 @@ static void test_debugger(void)
|
||||||
/* debugger gets first chance exception with unmodified ctx.Eip */
|
/* debugger gets first chance exception with unmodified ctx.Eip */
|
||||||
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb, "Eip at 0x%x instead of %p\n",
|
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb, "Eip at 0x%x instead of %p\n",
|
||||||
ctx.Eip, (char *)code_mem_address + 0xb);
|
ctx.Eip, (char *)code_mem_address + 0xb);
|
||||||
ctx.Eip = 0x12345;
|
ctx.Eip = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.Eax = 0xf00f00f1;
|
ctx.Eax = 0xf00f00f1;
|
||||||
/* pass exception to debuggee
|
/* pass exception to debuggee
|
||||||
* exception will not be handled and a second chance exception will be raised */
|
* exception will not be handled and a second chance exception will be raised */
|
||||||
|
@ -1071,7 +1075,8 @@ static void test_debugger(void)
|
||||||
if (de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
|
if (de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
|
||||||
{
|
{
|
||||||
ok((char *)ctx.Eip == (char *)code_mem_address + 0xa ||
|
ok((char *)ctx.Eip == (char *)code_mem_address + 0xa ||
|
||||||
broken(is_wow64 && (char *)ctx.Eip == (char *)code_mem_address + 0xb),
|
broken(is_wow64 && (char *)ctx.Eip == (char *)code_mem_address + 0xb) ||
|
||||||
|
broken((char *)ctx.Eip == (char *)code_mem_address + 0xd) /* w2008 */,
|
||||||
"Eip at 0x%x instead of %p\n",
|
"Eip at 0x%x instead of %p\n",
|
||||||
ctx.Eip, (char *)code_mem_address + 0xa);
|
ctx.Eip, (char *)code_mem_address + 0xa);
|
||||||
/* need to fixup Eip for debuggee */
|
/* need to fixup Eip for debuggee */
|
||||||
|
@ -1079,7 +1084,9 @@ static void test_debugger(void)
|
||||||
ctx.Eip += 1;
|
ctx.Eip += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb, "Eip at 0x%x instead of %p\n",
|
ok((char *)ctx.Eip == (char *)code_mem_address + 0xb ||
|
||||||
|
broken((char *)ctx.Eip == (char *)code_mem_address + 0xd) /* w2008 */,
|
||||||
|
"Eip at 0x%x instead of %p\n",
|
||||||
ctx.Eip, (char *)code_mem_address + 0xb);
|
ctx.Eip, (char *)code_mem_address + 0xb);
|
||||||
/* here we handle exception */
|
/* here we handle exception */
|
||||||
}
|
}
|
||||||
|
@ -2933,8 +2940,8 @@ static void test_debugger(void)
|
||||||
ok((char *)ctx.Rip == (char *)code_mem_address + 0xb, "Rip at %p instead of %p\n",
|
ok((char *)ctx.Rip == (char *)code_mem_address + 0xb, "Rip at %p instead of %p\n",
|
||||||
(char *)ctx.Rip, (char *)code_mem_address + 0xb);
|
(char *)ctx.Rip, (char *)code_mem_address + 0xb);
|
||||||
/* setting the context from debugger does not affect the context that the
|
/* setting the context from debugger does not affect the context that the
|
||||||
* exception handler gets */
|
* exception handler gets, except on w2008 */
|
||||||
ctx.Rip = 0x12345;
|
ctx.Rip = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.Rax = 0xf00f00f1;
|
ctx.Rax = 0xf00f00f1;
|
||||||
/* let the debuggee handle the exception */
|
/* let the debuggee handle the exception */
|
||||||
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||||
|
@ -2946,8 +2953,8 @@ static void test_debugger(void)
|
||||||
ok((char *)ctx.Rip == (char *)code_mem_address + 0xb, "Rip at %p instead of %p\n",
|
ok((char *)ctx.Rip == (char *)code_mem_address + 0xb, "Rip at %p instead of %p\n",
|
||||||
(char *)ctx.Rip, (char *)code_mem_address + 0xb);
|
(char *)ctx.Rip, (char *)code_mem_address + 0xb);
|
||||||
/* setting the context from debugger does not affect the context that the
|
/* setting the context from debugger does not affect the context that the
|
||||||
* exception handler gets */
|
* exception handler gets, except on w2008 */
|
||||||
ctx.Rip = 0x12345;
|
ctx.Rip = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.Rax = 0xf00f00f1;
|
ctx.Rax = 0xf00f00f1;
|
||||||
/* pass exception to debuggee
|
/* pass exception to debuggee
|
||||||
* exception will not be handled and a second chance exception will be raised */
|
* exception will not be handled and a second chance exception will be raised */
|
||||||
|
@ -3732,8 +3739,8 @@ static void test_debugger(void)
|
||||||
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %x instead of %p\n",
|
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %x instead of %p\n",
|
||||||
ctx.Pc, (char *)code_mem_address + 0xb);
|
ctx.Pc, (char *)code_mem_address + 0xb);
|
||||||
/* setting the context from debugger does not affect the context that the
|
/* setting the context from debugger does not affect the context that the
|
||||||
* exception handler gets */
|
* exception handler gets, except on w2008 */
|
||||||
ctx.Pc = 0x12345;
|
ctx.Pc = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.R0 = 0xf00f00f1;
|
ctx.R0 = 0xf00f00f1;
|
||||||
/* let the debuggee handle the exception */
|
/* let the debuggee handle the exception */
|
||||||
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||||
|
@ -3745,7 +3752,7 @@ static void test_debugger(void)
|
||||||
/* debugger gets first chance exception with unmodified ctx.Pc */
|
/* debugger gets first chance exception with unmodified ctx.Pc */
|
||||||
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at 0x%x instead of %p\n",
|
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at 0x%x instead of %p\n",
|
||||||
ctx.Pc, (char *)code_mem_address + 0xb);
|
ctx.Pc, (char *)code_mem_address + 0xb);
|
||||||
ctx.Pc = 0x12345;
|
ctx.Pc = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.R0 = 0xf00f00f1;
|
ctx.R0 = 0xf00f00f1;
|
||||||
/* pass exception to debuggee
|
/* pass exception to debuggee
|
||||||
* exception will not be handled and a second chance exception will be raised */
|
* exception will not be handled and a second chance exception will be raised */
|
||||||
|
@ -4110,8 +4117,8 @@ static void test_debugger(void)
|
||||||
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %p instead of %p\n",
|
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %p instead of %p\n",
|
||||||
(char *)ctx.Pc, (char *)code_mem_address + 0xb);
|
(char *)ctx.Pc, (char *)code_mem_address + 0xb);
|
||||||
/* setting the context from debugger does not affect the context that the
|
/* setting the context from debugger does not affect the context that the
|
||||||
* exception handler gets */
|
* exception handler gets, except on w2008 */
|
||||||
ctx.Pc = 0x12345;
|
ctx.Pc = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.X0 = 0xf00f00f1;
|
ctx.X0 = 0xf00f00f1;
|
||||||
/* let the debuggee handle the exception */
|
/* let the debuggee handle the exception */
|
||||||
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
continuestatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||||
|
@ -4123,7 +4130,7 @@ static void test_debugger(void)
|
||||||
/* debugger gets first chance exception with unmodified ctx.Pc */
|
/* debugger gets first chance exception with unmodified ctx.Pc */
|
||||||
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %p instead of %p\n",
|
ok((char *)ctx.Pc == (char *)code_mem_address + 0xb, "Pc at %p instead of %p\n",
|
||||||
(char *)ctx.Pc, (char *)code_mem_address + 0xb);
|
(char *)ctx.Pc, (char *)code_mem_address + 0xb);
|
||||||
ctx.Pc = 0x12345;
|
ctx.Pc = (UINT_PTR)code_mem_address + 0xd;
|
||||||
ctx.X0 = 0xf00f00f1;
|
ctx.X0 = 0xf00f00f1;
|
||||||
/* pass exception to debuggee
|
/* pass exception to debuggee
|
||||||
* exception will not be handled and a second chance exception will be raised */
|
* exception will not be handled and a second chance exception will be raised */
|
||||||
|
|
Loading…
Reference in New Issue