Пример #1
0
 private void GetBlockingObjects()
 {
     if (this.context.Runtime != null && this.context.Heap != null && this.context.Heap.CanWalkHeap)
     {
         foreach (ClrThread thread in context.Runtime.Threads)
         {
             try {
                 foreach (BlockingObject obj in thread.BlockingObjects)
                 {
                     if (obj != null)
                     {
                         this.threads[thread.OSThreadId].BlockingObjects.Add(obj.ToSDModel());
                     }
                 }
             } catch (NullReferenceException e) {
                 // There is a CLRMD bug causing a NRE in `thread.BlockingObjects`. see https://github.com/Microsoft/clrmd/issues/85
                 context.WriteWarning("NullReferenceException in GetBlockingObjects. Known CLRMD bug (https://github.com/Microsoft/clrmd/issues/85)");
             }
         }
     }
     else
     {
         context.WriteWarning("Blocking objects could not be obtained, either there is no CLR in process, or no heap information.");
     }
 }
Пример #2
0
 public void GetBlockingObjects()
 {
     context.WriteLine(" --- Blocking objects in heap ---");
     try {
         if (this.context.Heap != null && this.context.Heap.CanWalkHeap)
         {
             context.WriteLine("{0,-20} {1,-10} {2,-8} {3,-20} {4,-20}", "Address", "Type", "Locked", "Owners", "Pending");
             foreach (BlockingObject obj in this.context.Heap.EnumerateBlockingObjects())
             {
                 this.blockingObjects.Add(obj.ToSDModel());
             }
         }
         else
         {
             context.WriteWarning("no heap information avaliable!");
         }
     } catch (NullReferenceException e) {
         context.WriteWarning("NullReferenceException in PrintChainForThread. Known CLRMD bug (https://github.com/Microsoft/clrmd/issues/85)");
     }
 }
Пример #3
0
 private void GetBlockingObjects()
 {
     if (this.context.Runtime != null && this.context.Heap != null && this.context.Heap.CanWalkHeap)
     {
         foreach (ClrThread thread in context.Runtime.Threads)
         {
             foreach (BlockingObject obj in thread.BlockingObjects)
             {
                 if (obj != null)
                 {
                     this.threads[thread.OSThreadId].BlockingObjects.Add(obj.ToSDModel());
                 }
             }
         }
     }
     else
     {
         context.WriteWarning("Blocking objects could not be obtained, either there is no CLR in process, or no heap information.");
     }
 }
Пример #4
0
        public void GetBlockingObjects()
        {
            context.WriteLine(" --- Blocking objects in heap ---");

            if (this.context.Heap != null && this.context.Heap.CanWalkHeap)
            {
                context.WriteLine("{0,-20} {1,-10} {2,-8} {3,-20} {4,-20}", "Address", "Type", "Locked", "Owners", "Pending");
                foreach (BlockingObject obj in this.context.Heap.EnumerateBlockingObjects())
                {
                    this.blockingObjects.Add(obj.ToSDModel());
                }
            }
            else
            {
                context.WriteWarning("no heap information avaliable!");
            }
        }