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-07-19 20:46:27 +0300
committerAndrew Au <andrewau@microsoft.com>2017-07-19 20:46:27 +0300
commit4ccc432c3813a655fc614d3c15d4e4a6518605b0 (patch)
tree018d8034b60978a9257985157e6596925bd86871 /src/System.Private.TypeLoader
parentf516117505e3a8f75622859136eaa87c259d0726 (diff)
Debugger Support
[tfs-changeset: 1666780]
Diffstat (limited to 'src/System.Private.TypeLoader')
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebugFuncEval.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebugFuncEval.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebugFuncEval.cs
index e7929ff7e..5f46def12 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebugFuncEval.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebugFuncEval.cs
@@ -223,7 +223,7 @@ namespace Internal.Runtime.DebuggerSupport
if (isConstructor)
{
- typesAndValues.thisObj = RuntimeAugments.NewObject(typesAndValues.types[1]);
+ typesAndValues.thisObj = CreateObject(typesAndValues.types[1]);
}
LocalVariableSet.SetupArbitraryLocalVariableSet<TypesAndValues>(HighLevelDebugFuncEvalHelperWithVariables, ref typesAndValues, argumentTypes);
@@ -249,7 +249,7 @@ namespace Internal.Runtime.DebuggerSupport
TypeSystemContextFactory.Recycle(typeSystemContext);
RuntimeTypeHandle objectTypeHandle = objectTypeDesc.GetRuntimeTypeHandle();
- object returnValue = RuntimeAugments.NewObject(objectTypeHandle);
+ object returnValue = CreateObject(objectTypeHandle);
GCHandle returnValueHandle = GCHandle.Alloc(returnValue);
IntPtr returnValueHandlePointer = GCHandle.ToIntPtr(returnValueHandle);
@@ -374,6 +374,25 @@ namespace Internal.Runtime.DebuggerSupport
// debugger magic will make sure this function never returns, instead control will be transferred back to the point where the FuncEval begins
}
+ private static unsafe object CreateObject(RuntimeTypeHandle objectTypeHandle)
+ {
+ object returnValue = null;
+ if (objectTypeHandle.Equals(typeof(IntPtr)))
+ {
+ returnValue = new IntPtr();
+ }
+ else if (objectTypeHandle.Equals(typeof(UIntPtr)))
+ {
+ returnValue = new UIntPtr();
+ }
+ else
+ {
+ returnValue = RuntimeAugments.NewObject(objectTypeHandle);
+ }
+
+ return returnValue;
+ }
+
public static void Initialize()
{
// We needed this function only because the McgIntrinsics attribute cannot be applied on the static constructor