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
path: root/src
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2017-05-18 03:23:06 +0300
committerAndrew Au <andrewau@microsoft.com>2017-05-18 03:23:06 +0300
commitafd750916dd70dfee38042111322707ba599c65e (patch)
tree4eec93416ddd2c21fc6de7ba4796e6d201bd5981 /src
parent31ad3927a6be78ccebce17104a92834b8d9778c3 (diff)
Debugger Support
[tfs-changeset: 1658797]
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs4
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs11
2 files changed, 10 insertions, 5 deletions
diff --git a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
index d2a9f0c1c..330580c99 100644
--- a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
+++ b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
@@ -297,6 +297,10 @@ namespace System.Runtime
// calls to runtime for allocation
//
[MethodImpl(MethodImplOptions.InternalCall)]
+ [RuntimeImport(RuntimeLibrary, "RhBoxAny")]
+ public static extern unsafe object RhBoxAny(IntPtr pData, IntPtr pEEType);
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhNewObject")]
internal static extern object RhNewObject(EETypePtr pEEType);
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
index 401617c8b..1e6790327 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
@@ -45,13 +45,14 @@ namespace Internal.Runtime.TypeLoader
// Invoke the target method
Internal.Runtime.CallInterceptor.CallInterceptor.MakeDynamicCall(targetAddress, dynamicCallSignature, arguments);
- // TODO: We should be able to handle arbitrary return type
- object returnValue = arguments.GetVar<int>(0);
- GCHandle returnValueHandle = GCHandle.Alloc(returnValue);
-
- // Signal to the debugger the func eval completes
unsafe
{
+ // Box the return
+ IntPtr input = arguments.GetAddressOfVarData(0);
+ object returnValue = RuntimeImports.RhBoxAny(input, (IntPtr)param.types[0].ToEETypePtr());
+ GCHandle returnValueHandle = GCHandle.Alloc(returnValue);
+
+ // Signal to the debugger the func eval completes
FuncEvalCompleteCommand* funcEvalCompleteCommand = stackalloc FuncEvalCompleteCommand[1];
funcEvalCompleteCommand->commandCode = 0;
funcEvalCompleteCommand->returnAddress = (long)GCHandle.ToIntPtr(returnValueHandle);