Commit 6085ab88 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use a .seh handler for the process breakpoint.

parent 1414adfa
......@@ -1619,6 +1619,19 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3
/***********************************************************************
* process_breakpoint
*/
#ifdef __WINE_PE_BUILD
__ASM_GLOBAL_FUNC( process_breakpoint,
".seh_endprologue\n\t"
".seh_handler process_breakpoint_handler, %except\n\t"
"udf #0xfe\n\t"
"bx lr\n"
"process_breakpoint_handler:\n\t"
"ldr r0, [r2, #0x40]\n\t" /* context->Pc */
"add r0, r0, #2\n\t"
"str r0, [r2, #0x40]\n\t"
"mov r0, #0\n\t" /* ExceptionContinueExecution */
"bx lr" )
#else
void WINAPI process_breakpoint(void)
{
__TRY
......@@ -1631,6 +1644,7 @@ void WINAPI process_breakpoint(void)
}
__ENDTRY
}
#endif
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
......
......@@ -1589,19 +1589,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3
/***********************************************************************
* process_breakpoint
*/
void WINAPI process_breakpoint(void)
{
__TRY
{
DbgBreakPoint();
}
__EXCEPT_ALL
{
/* do nothing */
}
__ENDTRY
}
__ASM_GLOBAL_FUNC( process_breakpoint,
".seh_endprologue\n\t"
".seh_handler process_breakpoint_handler, @except\n\t"
"brk #0xf000\n\t"
"ret\n"
"process_breakpoint_handler:\n\t"
"ldr x4, [x2, #0x108]\n\t" /* context->Pc */
"add x4, x4, #4\n\t"
"str x4, [x2, #0x108]\n\t"
"mov w0, #0\n\t" /* ExceptionContinueExecution */
"ret" )
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
......
......@@ -2004,19 +2004,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *arm_context, ULONG_PTR unk2, ULONG_PTR
/***********************************************************************
* process_breakpoint
*/
void WINAPI process_breakpoint(void)
{
__TRY
{
DbgBreakPoint();
}
__EXCEPT_ALL
{
/* do nothing */
}
__ENDTRY
}
__ASM_GLOBAL_FUNC( "#process_breakpoint",
".seh_endprologue\n\t"
".seh_handler process_breakpoint_handler, @except\n\t"
"brk #0xf000\n\t"
"ret\n"
"process_breakpoint_handler:\n\t"
"ldr x4, [x2, #0x108]\n\t" /* context->Pc */
"add x4, x4, #4\n\t"
"str x4, [x2, #0x108]\n\t"
"mov w0, #0\n\t" /* ExceptionContinueExecution */
"ret" )
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
......
......@@ -1728,6 +1728,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3
/***********************************************************************
* process_breakpoint
*/
#ifdef __WINE_PE_BUILD
__ASM_GLOBAL_FUNC( process_breakpoint,
".seh_endprologue\n\t"
".seh_handler process_breakpoint_handler, @except\n\t"
"int $3\n\t"
"ret\n"
"process_breakpoint_handler:\n\t"
"incq 0xf8(%r8)\n\t" /* context->Rip */
"xorl %eax,%eax\n\t" /* ExceptionContinueExecution */
"ret" )
#else
void WINAPI process_breakpoint(void)
{
__TRY
......@@ -1740,6 +1751,7 @@ void WINAPI process_breakpoint(void)
}
__ENDTRY
}
#endif
/**********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment