Fix for bug in memoryaccess when running with udeb kernel (ie when precondition asserts are enabled).
authorTom Sutcliffe <thomas.sutcliffe@accenture.com>
Tue, 30 Nov 2010 11:11:58 +0000
changeset 89 17bed177107f
parent 88 b44958a4977b
child 90 ceac7084e2e5
Fix for bug in memoryaccess when running with udeb kernel (ie when precondition asserts are enabled).
libraries/memoryaccess/fdebuggerkernel.cpp
--- a/libraries/memoryaccess/fdebuggerkernel.cpp	Sun Nov 07 12:43:47 2010 +0000
+++ b/libraries/memoryaccess/fdebuggerkernel.cpp	Tue Nov 30 11:11:58 2010 +0000
@@ -104,6 +104,8 @@
 
 TUint DDebuggerEventHandler::DoEvent(TKernelEvent aEvent, TAny* a1, TAny* a2)
 	{
+	if (Kern::CurrentThread().iOwningProcess->iId == 1) return ERunNext; // There's nothing we can safely do in the context of a kernel thread, because they might already be holding a mutex (which definitely happens in the case of EEventAddThread)
+
 	//if (aEvent != EEventUserTrace) Kern::Printf("fdbk: Event %d a1=%d a2=%d", aEvent, a1, a2);
 
 	if (aEvent == EEventKillThread)
@@ -213,6 +215,9 @@
 			}
 		return (TUint)DKernelEventHandler::EExcHandled;
 #else
+		// Do this regardless to get the benefit of the kernel's mutex order checking in winscw udeb
+		BreakpointLock();
+		BreakpointUnlock();
 		(void)a1;
 #endif
 		}