diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index c0cf57474e2..c7dc5c22a86 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bug.c,v 1.41 2003/12/30 18:52:04 fireball Exp $ +/* $Id: bug.c,v 1.42 2004/03/06 22:24:13 dwelch Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/bug.c @@ -163,11 +163,11 @@ KeBugCheckWithTf(ULONG BugCheckCode, { #if defined(__GNUC__) __asm__("sti\n\t"); - DbgBreakPoint(); + DbgBreakPointNoBugCheck(); __asm__("cli\n\t"); #elif defined(_MSC_VER) __asm sti - DbgBreakPoint(); + DbgBreakPointNoBugCheck(); __asm cli #else #error Unknown compiler for inline assembler @@ -293,11 +293,11 @@ KeBugCheckEx(ULONG BugCheckCode, { #if defined(__GNUC__) __asm__("sti\n\t"); - DbgBreakPoint(); + DbgBreakPointNoBugCheck(); __asm__("cli\n\t"); #elif defined(_MSC_VER) __asm sti - DbgBreakPoint(); + DbgBreakPointNoBugCheck(); __asm cli #else #error Unknown compiler for inline assembler diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index f6c35a2c94f..e715b1bf85f 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.39 2003/12/30 18:52:04 fireball Exp $ +/* $Id: catch.c,v 1.40 2004/03/06 22:24:13 dwelch Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c @@ -163,9 +163,9 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, if (Value != ExceptionContinueExecution || 0 != (ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { - DbgPrint("ExceptionRecord->ExceptionAddress = 0x%x\n", - ExceptionRecord->ExceptionAddress ); - KEBUGCHECKWITHTF(KMODE_EXCEPTION_NOT_HANDLED, 0, 0, 0, 0, Tf); + DPRINT("ExceptionRecord->ExceptionAddress = 0x%x\n", + ExceptionRecord->ExceptionAddress ); + KeBugCheckWithTf(KMODE_EXCEPTION_NOT_HANDLED, 0, 0, 0, 0, Tf); } } } diff --git a/reactos/ntoskrnl/ke/i386/brkpoint.c b/reactos/ntoskrnl/ke/i386/brkpoint.c index eea7b63ca32..150648c53a5 100644 --- a/reactos/ntoskrnl/ke/i386/brkpoint.c +++ b/reactos/ntoskrnl/ke/i386/brkpoint.c @@ -46,6 +46,16 @@ DbgBreakPoint(VOID) #endif } +/* + * @implemented + */ +#if defined(__GNUC__) +__asm__(".globl _DbgBreakPointNoBugCheck@0\n\t" + "_DbgBreakPointNoBugCheck@0:\n\t" + "int $3\n\t" + "ret\n\t"); +#endif + /* * @implemented */ diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index 0645581eed6..5ce3880ce5f 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -288,8 +288,8 @@ KiDoubleFaultHandler(VOID) OldTss->Fs, OldTss->Gs); DbgPrint("EAX: %.8x EBX: %.8x ECX: %.8x\n", OldTss->Eax, OldTss->Ebx, OldTss->Ecx); - DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x\n", OldTss->Edx, OldTss->Ebp, - OldTss->Esi); + DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x\n ESP: %.8x", OldTss->Edx, + OldTss->Ebp, OldTss->Esi, Esp0); DbgPrint("EDI: %.8x EFLAGS: %.8x ", OldTss->Edi, OldTss->Eflags); if (OldTss->Cs == KERNEL_CS) { @@ -307,7 +307,6 @@ KiDoubleFaultHandler(VOID) } if ((OldTss->Cs & 0xffff) == KERNEL_CS) { - DbgPrint("ESP %x\n", Esp0); if (PsGetCurrentThread() != NULL) { StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase; @@ -468,7 +467,8 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2) DbgPrint("DS %x ES %x FS %x GS %x\n", Tf->Ds&0xffff, Tf->Es&0xffff, Tf->Fs&0xffff, Tf->Gs&0xfff); DbgPrint("EAX: %.8x EBX: %.8x ECX: %.8x\n", Tf->Eax, Tf->Ebx, Tf->Ecx); - DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x\n", Tf->Edx, Tf->Ebp, Tf->Esi); + DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x ESP: %.8x\n", Tf->Edx, + Tf->Ebp, Tf->Esi, Esp0); DbgPrint("EDI: %.8x EFLAGS: %.8x ", Tf->Edi, Tf->Eflags); if ((Tf->Cs&0xffff) == KERNEL_CS) { @@ -481,8 +481,6 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2) } } - DbgPrint("ESP %x\n", Esp0); - if (PsGetCurrentThread() != NULL) { StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase; @@ -594,6 +592,18 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr) } } + /* + * Check for a breakpoint that was only for the attention of the debugger. + */ + if (ExceptionNr == 3 && Tf->Eip == ((ULONG)DbgBreakPointNoBugCheck) + 1) + { + /* + EIP is already adjusted by the processor to point to the instruction + after the breakpoint. + */ + return(0); + } + /* * Handle user exceptions differently */