diff options
author | Andrew Au <andrewau@microsoft.com> | 2017-05-12 23:03:52 +0300 |
---|---|---|
committer | Andrew Au <andrewau@microsoft.com> | 2017-05-12 23:03:52 +0300 |
commit | 1f6a7869b3c3ef5bfe13443c836ede9266d52757 (patch) | |
tree | 9dce71d5ea2f77c3e9aa94b2a1dd4f3ee26a7b08 /src/Native/Runtime/DebuggerHook.cpp | |
parent | ed16cfd73de7139699c55af5ad5758e13155f69a (diff) |
Debugger Support
[tfs-changeset: 1658215]
Diffstat (limited to 'src/Native/Runtime/DebuggerHook.cpp')
-rw-r--r-- | src/Native/Runtime/DebuggerHook.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/Native/Runtime/DebuggerHook.cpp b/src/Native/Runtime/DebuggerHook.cpp index 688eb69f6..d4a74db75 100644 --- a/src/Native/Runtime/DebuggerHook.cpp +++ b/src/Native/Runtime/DebuggerHook.cpp @@ -6,6 +6,7 @@ #include "CommonTypes.h" #include "DebuggerHook.h" #include "DebugEventSource.h" +#include "Debug.h" GVAL_IMPL_INIT(UInt32, g_numGcProtectionRequests, 0); @@ -13,24 +14,6 @@ GVAL_IMPL_INIT(UInt32, g_numGcProtectionRequests, 0); /* static */ DebuggerProtectedBufferList* DebuggerHook::s_debuggerProtectedBuffers = nullptr; -// TODO: Tab to space, overall, just to make sure I will actually do it :) -// TODO: This structure needs to match with DBI -struct FuncEvalParameterCommand -{ - // TODO: Consider giving these command code a good enumeration to define what they really are - UInt32 commandCode; - UInt32 unused; /* To make the data structure 64 bit aligned */ - UInt64 bufferAddress; -}; - -// TODO: This structure needs to match with DBI -struct GcProtectionRequest -{ - UInt16 type; - UInt16 size; - UInt64 address; -}; - /* static */ void DebuggerHook::OnBeforeGcCollection() { if (g_numGcProtectionRequests > 0) @@ -42,8 +25,8 @@ struct GcProtectionRequest // TODO: We need to figure out how to communicate this broken promise to the debugger // Notifying the debugger the buffer is ready to use - FuncEvalParameterCommand command; - command.commandCode = 2; + GcProtectionMessage command; + command.commandCode = DebuggerGcProtectionMessage::RequestBufferReady; command.bufferAddress = (uint64_t)requests; DebugEventSource::SendCustomEvent((void*)&command, sizeof(command)); @@ -52,7 +35,7 @@ struct GcProtectionRequest // The debugger has filled the requests array for (uint32_t i = 0; i < g_numGcProtectionRequests; i++) { - if (requests[i].type == 1) + if (requests[i].type == DebuggerGcProtectionRequestKind::ConservativeReporting) { // If the request requires extra memory, allocate for it requests[i].address = (uint64_t)new (nothrow) uint8_t[requests[i].size]; @@ -61,14 +44,14 @@ struct GcProtectionRequest } } - command.commandCode = 3; + command.commandCode = DebuggerGcProtectionMessage::ConservativeReportingBufferReady; DebugEventSource::SendCustomEvent((void*)&command, sizeof(command)); // ... debugger magic happen here again ... for (uint32_t i = 0; i < g_numGcProtectionRequests; i++) { - if (requests[i].type == 1) + if (requests[i].type == DebuggerGcProtectionRequestKind::ConservativeReporting) { // TODO: Release them when there should be gone DebuggerProtectedBufferList* tail = DebuggerHook::s_debuggerProtectedBuffers; |