Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2017-04-06 21:21:11 +0300
committerAndrew Au <andrewau@microsoft.com>2017-04-06 21:21:11 +0300
commit5b69cf3cab2f902a63793596d689fd0008f9b1fd (patch)
treee16c49ce6b26e07e270e6e8adb2f1b7e2d69c6a9 /src/Native/Runtime/DebuggerHook.cpp
parentc1d3fe1c2df77a009b5bcfacd0f93977c08011ba (diff)
Some runtime support for debugging scenario
[tfs-changeset: 1653409]
Diffstat (limited to 'src/Native/Runtime/DebuggerHook.cpp')
-rw-r--r--src/Native/Runtime/DebuggerHook.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Native/Runtime/DebuggerHook.cpp b/src/Native/Runtime/DebuggerHook.cpp
index a6f65831d..688eb69f6 100644
--- a/src/Native/Runtime/DebuggerHook.cpp
+++ b/src/Native/Runtime/DebuggerHook.cpp
@@ -11,6 +11,8 @@ GVAL_IMPL_INIT(UInt32, g_numGcProtectionRequests, 0);
#ifndef DACCESS_COMPILE
+/* 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
@@ -54,6 +56,8 @@ struct GcProtectionRequest
{
// If the request requires extra memory, allocate for it
requests[i].address = (uint64_t)new (nothrow) uint8_t[requests[i].size];
+
+ // The debugger will handle the case when address is nullptr (we have to break our promise)
}
}
@@ -66,7 +70,19 @@ struct GcProtectionRequest
{
if (requests[i].type == 1)
{
- // What shall I do?
+ // TODO: Release them when there should be gone
+ DebuggerProtectedBufferList* tail = DebuggerHook::s_debuggerProtectedBuffers;
+ s_debuggerProtectedBuffers = new (std::nothrow) DebuggerProtectedBufferList();
+ if (s_debuggerProtectedBuffers == nullptr)
+ {
+ // TODO: We cannot handle the debugger request to protect a buffer (we have to break our promise)
+ }
+ else
+ {
+ s_debuggerProtectedBuffers->address = requests[i].address;
+ s_debuggerProtectedBuffers->size = requests[i].size;
+ s_debuggerProtectedBuffers->next = tail;
+ }
}
}