diff options
author | Andrew Au <andrewau@microsoft.com> | 2018-05-24 15:52:32 -0700 |
---|---|---|
committer | Andrew Au <cshung@gmail.com> | 2018-11-06 18:34:47 -0800 |
commit | 6a9384827f7e1059bec5e246425e46cc7f3fc140 (patch) | |
tree | 9ee511bd27581e6023486c4a5ab4cd084d976fc6 /src/debug/ee | |
parent | 8d6583e38f4e9b00ec21666225760a0df97afaec (diff) | |
download | coreclr-6a9384827f7e1059bec5e246425e46cc7f3fc140.tar.gz coreclr-6a9384827f7e1059bec5e246425e46cc7f3fc140.tar.bz2 coreclr-6a9384827f7e1059bec5e246425e46cc7f3fc140.zip |
Removing unnecessary hacks
Diffstat (limited to 'src/debug/ee')
-rw-r--r-- | src/debug/ee/controller.cpp | 21 | ||||
-rw-r--r-- | src/debug/ee/controller.h | 2 | ||||
-rw-r--r-- | src/debug/ee/debugger.cpp | 14 | ||||
-rw-r--r-- | src/debug/ee/debugger.h | 2 | ||||
-rw-r--r-- | src/debug/ee/rcthread.cpp | 2 |
5 files changed, 8 insertions, 33 deletions
diff --git a/src/debug/ee/controller.cpp b/src/debug/ee/controller.cpp index 7b14244064..5ae9a9596b 100644 --- a/src/debug/ee/controller.cpp +++ b/src/debug/ee/controller.cpp @@ -46,6 +46,7 @@ DebuggerControllerPage *DebuggerController::g_protections = NULL; CrstStatic DebuggerController::g_criticalSection; int DebuggerController::g_cTotalMethodEnter = 0; + // Is this patch at a position at which it's safe to take a stack? bool DebuggerControllerPatch::IsSafeForStackTrace() { @@ -3026,26 +3027,6 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE context->Dr2 = c.Dr2; context->Dr3 = c.Dr3; - //if (context->Dr0 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 0) - //{ - // DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context); - //} - - //if (context->Dr1 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 1) - //{ - // DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context); - //} - - //if (context->Dr2 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 2) - //{ - // DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context); - //} - - //if (context->Dr3 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 3) - //{ - // DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context); - //} - if (!atSafePlace) g_pDebugger->DecThreadsAtUnsafePlaces(); diff --git a/src/debug/ee/controller.h b/src/debug/ee/controller.h index 5a469810b3..4d91d7d915 100644 --- a/src/debug/ee/controller.h +++ b/src/debug/ee/controller.h @@ -991,7 +991,7 @@ inline void VerifyExecutableAddress(const BYTE* address) // DebuggerController: DebuggerController serves // both as a static class that dispatches exceptions coming from the -// EE, and as an abstract base class for the five classes that derive +// EE, and as an abstract base class for the five classes that derrive // from it. class DebuggerController { diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index 1099032844..8439e0fc78 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -11461,7 +11461,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) Object * pObject = (Object*)pEvent->CreateHandle.objectToken; OBJECTREF objref = ObjectToOBJECTREF(pObject); AppDomain * pAppDomain = pEvent->vmAppDomain.GetRawPtr(); - int fStrong = (int) pEvent->CreateHandle.fStrong; + BOOL fStrong = pEvent->CreateHandle.fStrong; OBJECTHANDLE objectHandle; // This is a synchronous event (reply required) @@ -11482,10 +11482,6 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) // create strong handle objectHandle = pAppDomain->CreateStrongHandle(objref); } - else if (fStrong == 2) - { - objectHandle = pAppDomain->CreatePinningHandle(objref); - } else { // create the weak long handle @@ -11754,12 +11750,8 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_GET_CONTAINER: { DebuggerIPCEvent * pResult = m_pRCThread->GetIPCEventReceiveBuffer(); - // TODO, databp, replace with the right find_object call - pResult->GetContainerResult.answer = ((void*)(((long long)pEvent->GetContainer.interiorPointer) - sizeof(void*))); - - // This is the right code for calling the method in GC, but that code has a bug such that it does not work in this scenario - // Object *pObject = GCHeapUtilities::GetGCHeap()->GetContainingObject(pEvent->GetContainer.interiorPointer, false); - // pResult->GetContainerResult.answer = pObject; + Object *pObject = GCHeapUtilities::GetGCHeap()->GetContainingObject(pEvent->GetContainer.interiorPointer, false); + pResult->GetContainerResult.answer = pObject; InitIPCEvent(pResult, DB_IPCE_GET_CONTAINER_RESULT, NULL, NULL); pResult->hr = S_OK; m_pRCThread->SendIPCReply(); diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h index ac0f7be9f3..10d62d6369 100644 --- a/src/debug/ee/debugger.h +++ b/src/debug/ee/debugger.h @@ -418,7 +418,7 @@ HRESULT ValidateObject(Object *objPtr); //----------------------------------------------------------------------------- // Execution control needs several ways to get at the context of a thread -// stopped in managed code (stepping, setip, func-eval). +// stopped in mangaged code (stepping, setip, func-eval). // We want to abstract away a few things: // - active: this thread is stopped at a patch // - inactive: this threads was managed suspended somewhere in jitted code diff --git a/src/debug/ee/rcthread.cpp b/src/debug/ee/rcthread.cpp index 200e91e50b..00a2fdcfca 100644 --- a/src/debug/ee/rcthread.cpp +++ b/src/debug/ee/rcthread.cpp @@ -13,6 +13,7 @@ #include "stdafx.h" #include "threadsuspend.h" #ifndef FEATURE_PAL + #include "securitywrapper.h" #endif #include <aclapi.h> @@ -1795,6 +1796,7 @@ HRESULT DebuggerRCThread::SendIPCEvent() } } + PRECONDITION(ThisMaybeHelperThread()); } CONTRACTL_END; |