diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-06-09 21:46:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 21:46:09 +0300 |
commit | de86c30b1f65cda5469d39182040aa5c146eb56e (patch) | |
tree | c36b41cd61313522a2fd30ef6f273f4b9e1925cf | |
parent | 1a18bf8844d8aa534ac21248dd2137a8f916f04d (diff) | |
parent | 0f8038d7816aba9bdbad3adb6f693ebe03cb1f83 (diff) |
Merge pull request #3848 from dotnet-bot/from-tfs
Merge changes from TFS
-rw-r--r-- | src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs | 31 |
1 files changed, 24 insertions, 7 deletions
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 69b738be2..624c41fc1 100644 --- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs +++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs @@ -28,7 +28,18 @@ namespace Internal.Runtime.TypeLoader { for (int i = 0; i < param.parameterValues.Length; i++) { - arguments.SetVar<int>(i + 1, param.parameterValues[i]); + unsafe + { + IntPtr input = arguments.GetAddressOfVarData(i + 1); + byte* pInput = (byte*)input; + fixed(byte* pParam = param.parameterValues[i]) + { + for (int j = 0; j < param.parameterValues[i].Length; j++) + { + pInput[j] = pParam[j]; + } + } + } } // Obtain the target method address from the runtime @@ -92,8 +103,7 @@ namespace Internal.Runtime.TypeLoader struct TypesAndValues { public RuntimeTypeHandle[] types; - // TODO: We should support arguments of *any* type - public int[] parameterValues; + public byte[][] parameterValues; } private static void HighLevelDebugFuncEvalHelper() @@ -123,7 +133,7 @@ namespace Internal.Runtime.TypeLoader uint trash; uint parameterCount; - uint parameterValue; + uint parameterValueSize; uint eeTypeCount; ulong eeType; uint offset = 0; @@ -132,11 +142,18 @@ namespace Internal.Runtime.TypeLoader offset = reader.DecodeUnsigned(offset, out trash); // The VertexSequence always generate a length, I don't really need it. offset = reader.DecodeUnsigned(offset, out parameterCount); - typesAndValues.parameterValues = new int[parameterCount]; + typesAndValues.parameterValues = new byte[parameterCount][]; for (int i = 0; i < parameterCount; i++) { - offset = reader.DecodeUnsigned(offset, out parameterValue); - typesAndValues.parameterValues[i] = (int)parameterValue; + offset = reader.DecodeUnsigned(offset, out parameterValueSize); + byte[] parameterValue = new byte[parameterValueSize]; + for (int j = 0; j < parameterValueSize; j++) + { + uint parameterByte; + offset = reader.DecodeUnsigned(offset, out parameterByte); + parameterValue[j] = (byte)parameterByte; + } + typesAndValues.parameterValues[i] = parameterValue; } offset = reader.DecodeUnsigned(offset, out eeTypeCount); ulong[] debuggerPreparedExternalReferences = new ulong[eeTypeCount]; |