private IntPtr[] rgMethodHandle;
private string[] rgAssemblyPath;
+ private Assembly[] rgAssembly;
private IntPtr[] rgLoadedPeAddress;
private int[] rgiLoadedPeSize;
private IntPtr[] rgInMemoryPdbAddress;
private int iFrameCount;
#pragma warning restore 414
- private delegate void GetSourceLineInfoDelegate(string assemblyPath, IntPtr loadedPeAddress, int loadedPeSize,
- IntPtr inMemoryPdbAddress, int inMemoryPdbSize, int methodToken, int ilOffset,
+ private delegate void GetSourceLineInfoDelegate(Assembly assembly, string assemblyPath, IntPtr loadedPeAddress,
+ int loadedPeSize, IntPtr inMemoryPdbAddress, int inMemoryPdbSize, int methodToken, int ilOffset,
out string sourceFile, out int sourceLine, out int sourceColumn);
private static GetSourceLineInfoDelegate s_getSourceLineInfo = null;
rgiOffset = null;
rgiILOffset = null;
rgAssemblyPath = null;
+ rgAssembly = null;
rgLoadedPeAddress = null;
rgiLoadedPeSize = null;
rgInMemoryPdbAddress = null;
// ENC or the source/line info was already retrieved, the method token is 0.
if (rgiMethodToken[index] != 0)
{
- s_getSourceLineInfo(rgAssemblyPath[index], rgLoadedPeAddress[index], rgiLoadedPeSize[index],
+ s_getSourceLineInfo(rgAssembly[index], rgAssemblyPath[index], rgLoadedPeAddress[index], rgiLoadedPeSize[index],
rgInMemoryPdbAddress[index], rgiInMemoryPdbSize[index], rgiMethodToken[index],
rgiILOffset[index], out rgFilename[index], out rgiLineNumber[index], out rgiColumnNumber[index]);
}
SetObjectReference( (OBJECTREF *)&(pStackFrameHelper->rgAssemblyPath), (OBJECTREF)assemblyPathArray,
pStackFrameHelper->GetAppDomain());
+ // Allocate memory for the array of assemblies
+ MethodTable * pAssemblyMT = MscorlibBinder::GetClass(CLASS__ASSEMBLY);
+ PTRARRAYREF assemblyArray = (PTRARRAYREF) AllocateObjectArray(data.cElements, pAssemblyMT);
+ SetObjectReference( (OBJECTREF *)&(pStackFrameHelper->rgAssembly), (OBJECTREF)assemblyArray,
+ pStackFrameHelper->GetAppDomain());
+
// Allocate memory for the LoadedPeAddress
BASEARRAYREF loadedPeAddressArray = (BASEARRAYREF) AllocatePrimitiveArray(ELEMENT_TYPE_I, data.cElements);
SetObjectReference( (OBJECTREF *)&(pStackFrameHelper->rgLoadedPeAddress), (OBJECTREF)loadedPeAddressArray,
I4 *pILI4 = (I4 *)((I4ARRAYREF)pStackFrameHelper->rgiILOffset)->GetDirectPointerToNonObjectElements();
pILI4[iNumValidFrames] = data.pElements[i].dwILOffset;
+ // Assembly
+ OBJECTREF *pAssemblyArray = pStackFrameHelper->rgAssembly->GetDataPtr();
+ pAssemblyArray[iNumValidFrames] = pFunc->GetAssembly()->GetDomainAssembly()->GetExposedAssemblyObject();
+
if (data.fDoWeHaveAnyFramesFromForeignStackTrace)
{
// Set the BOOL indicating if the frame represents the last frame from a foreign exception stack trace.
PTRARRAYREF dynamicMethods;
BASEARRAYREF rgMethodHandle;
PTRARRAYREF rgAssemblyPath;
+ PTRARRAYREF rgAssembly;
BASEARRAYREF rgLoadedPeAddress;
I4ARRAYREF rgiLoadedPeSize;
BASEARRAYREF rgInMemoryPdbAddress;