Пример #1
0
 int GetContextStackTrace(
     IntPtr self,
     IntPtr startContext,
     uint startContextSize,
     DEBUG_STACK_FRAME[] frames,
     uint framesSize,
     IntPtr frameContexts,
     uint frameContextsSize,
     uint frameContextsEntrySize,
     uint *framesFilled)
 {
     // Don't fail, but always return 0 native frames so "clrstack -f" still prints the managed frames
     SOSHost.Write(framesFilled);
     return(S_OK);
 }
Пример #2
0
 unsafe int GetModuleInfo(
     IntPtr self,
     uint index,
     ulong *moduleBase,
     ulong *moduleSize)
 {
     try
     {
         ModuleInfo module = _soshost.DataReader.EnumerateModules().ElementAt((int)index);
         if (module == null)
         {
             return(E_FAIL);
         }
         SOSHost.Write(moduleBase, module.ImageBase);
         SOSHost.Write(moduleSize, module.FileSize);
     }
     catch (ArgumentOutOfRangeException)
     {
         return(E_FAIL);
     }
     return(S_OK);
 }