コード例 #1
0
 // frameInfoCode is the ClrFunctionId OR the NativeIP, depending on codeKind
 public bool TryGetFrameAtIndex(UInt16 index, out StackFrameCodeKind codeKind, out UInt64 frameInfoCode)
 {
     if (IsValid() && 0 <= index && index < GetFramesCountUnsafe())
     {
         GetFrameAtIndexUnsafe(index, out codeKind, out frameInfoCode);
         return(true);
     }
     else
     {
         codeKind      = StackFrameCodeKind.Unknown;
         frameInfoCode = 0;
         return(false);
     }
 }
コード例 #2
0
 public static void TryResolveStackFrameSymbols(
     StackFrameCodeKind frameCodeKind,
     UInt64 frameInfoCode,
     ref IntPtr pFunctionName,
     ref IntPtr pContainingTypeName,
     ref IntPtr pContainingAssemblyName)
 {
     if (Environment.Is64BitProcess)
     {
         if (!TryResolveStackFrameSymbols_x64(frameCodeKind, frameInfoCode, ref pFunctionName, ref pContainingTypeName, ref pContainingAssemblyName))
         {
             ClrShutdownException.Throw("TryResolveStackFrameSymbols is called AFTER CLR shutdown");
         }
     }
     else
     {
         if (!TryResolveStackFrameSymbols_x86(frameCodeKind, frameInfoCode, ref pFunctionName, ref pContainingTypeName, ref pContainingAssemblyName))
         {
             ClrShutdownException.Throw("TryResolveStackFrameSymbols is called AFTER CLR shutdown");
         }
     }
 }
コード例 #3
0
 [return : MarshalAs(UnmanagedType.Bool)] // default value, but use the attribute to make it explicit that it is a 4 bytes integer value (i.e. C BOOL on the native side)
 private static extern bool TryResolveStackFrameSymbols_x64(
     StackFrameCodeKind frameCodeKind,
     UInt64 frameInfoCode,
     ref IntPtr pFunctionName,
     ref IntPtr pContainingTypeName,
     ref IntPtr pContainingAssemblyName);
コード例 #4
0
 public void GetFrameAtIndexUnsafe(UInt16 index, out StackFrameCodeKind codeKind, out UInt64 frameInfoCode)
 {
     codeKind      = (StackFrameCodeKind)Marshal.ReadByte(ptr: _dataPtr, ofs: 26 + index * 9);
     frameInfoCode = (UInt64)Marshal.ReadInt64(ptr: _dataPtr, ofs: 27 + index * 9);
 }