From 1986f5d524f1f86806051a8bd955f9d21fd00d01 Mon Sep 17 00:00:00 2001 From: John Salem Date: Mon, 25 Feb 2019 14:53:16 -0800 Subject: [PATCH] Simplify getting exposed Assembly, and specifies parameter types for GetSourceLineInfo Commit migrated from https://github.com/dotnet/coreclr/commit/3d26dad131abc354aeb4388139ecfaafe6cc4c60 --- .../src/System/Diagnostics/StackFrameHelper.cs | 8 +++++++- src/coreclr/src/vm/debugdebugger.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs index 8b6d73e..8885db9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs @@ -117,7 +117,13 @@ namespace System.Diagnostics return; } - MethodInfo symbolsMethodInfo = symbolsType.GetMethod("GetSourceLineInfo", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + Type[] parameterTypes = new Type[] + { + typeof(string), typeof(IntPtr), typeof(int), typeof(IntPtr), + typeof(int), typeof(int), typeof(int), + typeof(string).MakeByRefType(), typeof(int).MakeByRefType(), typeof(int).MakeByRefType() + }; + MethodInfo symbolsMethodInfo = symbolsType.GetMethod("GetSourceLineInfo", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, parameterTypes, null); if (symbolsMethodInfo == null) { return; diff --git a/src/coreclr/src/vm/debugdebugger.cpp b/src/coreclr/src/vm/debugdebugger.cpp index ca6cfb0..d63433f 100644 --- a/src/coreclr/src/vm/debugdebugger.cpp +++ b/src/coreclr/src/vm/debugdebugger.cpp @@ -518,7 +518,7 @@ FCIMPL4(void, DebugStackTrace::GetStackFramesInternal, pILI4[iNumValidFrames] = data.pElements[i].dwILOffset; // Assembly - OBJECTREF pAssembly = pFunc->GetAssembly()->GetDomainAssembly()->GetExposedAssemblyObject(); + OBJECTREF pAssembly = pFunc->GetAssembly()->GetExposedObject(); pStackFrameHelper->rgAssembly->SetAt(iNumValidFrames, pAssembly); if (data.fDoWeHaveAnyFramesFromForeignStackTrace) -- 2.7.4