Added DbgBreakPoint. Fixed exception record contents on SIGTRAP.

This commit is contained in:
Alexandre Julliard 2000-03-07 13:10:21 +00:00
parent f2df6a2afe
commit 7d0dd5f327
4 changed files with 38 additions and 23 deletions

View File

@ -289,18 +289,11 @@ void WINAPI RtlRaiseStatus( NTSTATUS status )
/***********************************************************************
* EXC_DebugBreak / DebugBreak (KERNEL32.181)
* DebugBreak (KERNEL32.181)
*/
DEFINE_REGS_ENTRYPOINT_0( DebugBreak, EXC_DebugBreak )
void WINAPI EXC_DebugBreak( CONTEXT *context )
void WINAPI DebugBreak(void)
{
EXCEPTION_RECORD rec;
rec.ExceptionCode = EXCEPTION_BREAKPOINT;
rec.ExceptionFlags = 0;
rec.ExceptionRecord = NULL;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, context );
DbgBreakPoint();
}
@ -310,6 +303,13 @@ void WINAPI EXC_DebugBreak( CONTEXT *context )
void WINAPI DebugBreak16( CONTEXT86 *context )
{
#ifdef __i386__
EXC_DebugBreak( context );
EXCEPTION_RECORD rec;
rec.ExceptionCode = EXCEPTION_BREAKPOINT;
rec.ExceptionFlags = 0;
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = GET_IP(context);
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, context );
#endif /* defined(__i386__) */
}

View File

@ -24,7 +24,7 @@ type win32
@ stub CsrProbeForWrite
@ stub CsrSetPriorityClass
@ stub CsrpProcessCallbackRequest
@ stub DbgBreakPoint
@ stdcall DbgBreakPoint() DbgBreakPoint
@ varargs DbgPrint(str) DbgPrint
@ stub DbgPrompt
@ stub DbgSsHandleKmApiMsg
@ -32,7 +32,7 @@ type win32
@ stub DbgUiConnectToDbg
@ stub DbgUiContinue
@ stub DbgUiWaitStateChange
@ stub DbgUserBreakPoint
@ stdcall DbgUserBreakPoint() DbgUserBreakPoint
@ stub KiUserApcDispatcher
@ stub KiUserCallbackDispatcher
@ stub KiUserExceptionDispatcher

View File

@ -566,21 +566,25 @@ static HANDLER_DEF(trap_handler)
handler_init( &context, HANDLER_CONTEXT );
switch(get_trap_code(HANDLER_CONTEXT))
{
case T_TRCTRAP: /* Single-step exception */
rec.ExceptionCode = EXCEPTION_SINGLE_STEP;
break;
case T_BPTFLT: /* Breakpoint exception */
default:
rec.ExceptionCode = EXCEPTION_BREAKPOINT;
break;
}
save_context( &context, HANDLER_CONTEXT );
rec.ExceptionFlags = EXCEPTION_CONTINUABLE;
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.Eip;
rec.NumberParameters = 0;
switch(get_trap_code(HANDLER_CONTEXT))
{
case T_TRCTRAP: /* Single-step exception */
rec.ExceptionCode = EXCEPTION_SINGLE_STEP;
context.EFlags &= ~0x100; /* clear single-step flag */
break;
case T_BPTFLT: /* Breakpoint exception */
rec.ExceptionAddress--; /* back up over the int3 instruction */
/* fall through */
default:
rec.ExceptionCode = EXCEPTION_BREAKPOINT;
break;
}
EXC_RtlRaiseException( &rec, &context );
restore_context( &context, HANDLER_CONTEXT );
}
@ -725,4 +729,14 @@ BOOL SIGNAL_Init(void)
return FALSE;
}
/**********************************************************************
* DbgBreakPoint (NTDLL)
*/
__ASM_GLOBAL_FUNC( DbgBreakPoint, "int3; ret");
/**********************************************************************
* DbgUserBreakPoint (NTDLL)
*/
__ASM_GLOBAL_FUNC( DbgUserBreakPoint, "int3; ret");
#endif /* __i386__ */

View File

@ -961,6 +961,7 @@ NTSTATUS WINAPI NtClose(
/* misc */
void WINAPI DbgBreakPoint(void);
void WINAPIV DbgPrint(LPCSTR fmt, ...);
DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);