public ClrExceptionInformation(ClrDump clrDump, ClrException exception)
 {
     this.exception = exception;
     Message = clrDump.Eval(() => exception.Message);
     StackFrames = clrDump.Eval(() => exception.StackTrace.Select(frame => new StackFrameInformation(clrDump, frame))).ToList();
     TypeName = exception.Type.Name;
 }
 public ClrExceptionInformation(ClrDump clrDump, ClrException exception)
 {
     this.exception = exception;
     Message        = clrDump.Eval(() => exception.Message);
     StackFrames    = clrDump.Eval(() => exception.StackTrace.Select(frame => new StackFrameInformation(clrDump, frame))).ToList();
     TypeName       = exception.Type.Name;
 }
        public static void AddSizeColumn(this ObjectListView listView, Func <object, ulong> addressGetter, ClrDump dump, Func <object, ClrType> clrTypeGetter)
        {
            var col = new OLVColumn("Size", null)
            {
                Width = 60, TextAlign = HorizontalAlignment.Right
            };

            col.AspectGetter = o =>
            {
                if (o == null)
                {
                    return(null);
                }

                ulong address = addressGetter(o);
                if (address == 0)
                {
                    return(0);
                }
                object result = dump.Eval(
                    () => {
                    var type = clrTypeGetter(o);
                    if (type != null)
                    {
                        return(type.GetSize(address));
                    }
                    return((ulong)0);
                }
                    );
                return(result);
            };
            col.AspectToStringFormat = "{0:###,###,###,##0}";
            listView.AllColumns.Add(col);
        }
Exemplo n.º 4
0
 public FieldNode(string fieldName, ClrType clrType, ClrDump clrDump)
 {
     FieldName    = fieldName;
     ClrDump      = clrDump;
     this.ClrType = clrType;
     CanExpand    = ClrDump.Eval(() => ClrDump.HasField(clrType));
 }
Exemplo n.º 5
0
 public override void Init()
 {
     StackInstances = Thread == null
         ? null
         : ClrDump.Eval(() => Thread.EnumerateStackObjects().GroupBy(clrRoot => clrRoot.Object).Select(clrRootGroup => new StackInstanceInformation(ClrDump, clrRootGroup.First())).ToList());
     dlvStack.Objects = StackInstances;
 }
        public override void Init()
        {
            Exceptions = new List <ClrExceptionInformation>();
            ClrException exception = ClrDump.Eval(() => ClrThread.CurrentException);

            while (exception != null)
            {
                Exceptions.Add(new ClrExceptionInformation(ClrDump, exception));
                exception = ClrDump.Eval(() => exception.Inner);
            }

            dlvExceptions.Objects = Exceptions;
        }
Exemplo n.º 7
0
 public ModuleInformation(ClrDump clrDump, ClrModule module)
 {
     this.module = module;
     DebuggingMode = module.DebuggingMode;
     Pdb = clrDump.Eval(() =>
    {
        if (module.IsFile && module.Pdb != null)
        {
            return module.Pdb.FileName;
        }
        return null;
    });
 }
Exemplo n.º 8
0
 public ModuleInformation(ClrDump clrDump, ClrModule module)
 {
     this.module   = module;
     DebuggingMode = module.DebuggingMode;
     Pdb           = clrDump.Eval(() =>
     {
         if (module.IsFile && module.Pdb != null)
         {
             return(module.Pdb.FileName);
         }
         return(null);
     });
 }
Exemplo n.º 9
0
        public override void Init()
        {
            if (ClrDumpObject == null)
            {
                return;
            }

            mainFieldValues = FieldValueInformation.GetChildren(ClrDumpObject);
            SimpleValue     = ClrDump.Eval(() =>
            {
                return(SimpleValueHelper.IsSimpleValue(ClrDumpObject.ClrType)
                    ? SimpleValueHelper.GetSimpleValue(ClrDumpObject.Address, ClrDumpObject.ClrType)
                    : null);
            });
        }
Exemplo n.º 10
0
        public StackFrameInformation(ClrDump clrDump, ClrStackFrame frame)
        {
            this.clrDump = clrDump;
            this.frame = frame;
            DisplayString = frame.DisplayString;
            Kind = frame.Kind;
            Method = frame.Method;
            
#if LINE_AND_FILE
            if (frame.Kind != ClrStackFrameType.Runtime)
            {
                fileAndLineNumber = clrDump.Eval(() => frame.FileAndLineNumber());
            }
#endif
        }
        public StackFrameInformation(ClrDump clrDump, ClrStackFrame frame)
        {
            this.clrDump  = clrDump;
            this.frame    = frame;
            DisplayString = frame.DisplayString;
            Kind          = frame.Kind;
            Method        = frame.Method;

#if LINE_AND_FILE
            if (frame.Kind != ClrStackFrameType.Runtime)
            {
                fileAndLineNumber = clrDump.Eval(() => frame.FileAndLineNumber());
            }
#endif
        }
Exemplo n.º 12
0
        public static void AddSimpleValueColumn(this ObjectListView listView, Func <object, ulong> addressGetter, ClrDump dump, Func <object, ClrType> typeGetter)
        {
            var col = new OLVColumn("Value", null)
            {
                Width = 150
            };

            col.AspectGetter = o =>
            {
                ClrType type    = typeGetter(o);
                ulong   address = addressGetter(o);
                object  result  = dump.Eval(
                    () => {
                    if (type.IsPrimitive || type.IsString)
                    {
                        return(type.GetValue(address));
                    }
                    return(address);
                }
                    );
                return(result);
            };
            listView.AllColumns.Add(col);
            var menuItem = new ToolStripMenuItem("Copy Value");

            listView.ContextMenuStrip.Items.Add(menuItem);
            menuItem.Click += (o, e) =>
            {
                if (listView.SelectedItem == null)
                {
                    return;
                }

                int    index       = listView.SelectedItem.Index;
                var    modelObject = listView.GetModelObject(index);
                string val         = col.GetStringValue(modelObject);
                string escapeVal   = StringHelpers.Escape(val);
                if (string.IsNullOrEmpty(escapeVal))
                {
                    Clipboard.SetText("null");
                }
                else
                {
                    Clipboard.SetText(escapeVal);
                }
            };
        }
Exemplo n.º 13
0
        private void dlvSegments_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            if (e.ClickCount != 2)
            {
                return;
            }
            var segment = dlvSegments.SelectedObject <SegmentInformation>();

            if (segment == null)
            {
                return;
            }
            BeginTask("Looking for instances in segment...");
            var addressList = ClrDump.Eval(() => segment.Instances.ToList());
            var addresses   = new AddressContainerList(addressList);

            Status("Displaying instances in segment...");
            InstancesMixedModule.Create(ClrDump, addresses, this, mod => RequestDockModule(mod), $"{ClrDump.Id} - {segment.Start:X}");
            EndTask("Segment instances displayed.");
        }
Exemplo n.º 14
0
 public ModuleInformation(ClrDump clrDump, ClrModule module)
 {
     this.module   = module;
     DebuggingMode = module.DebuggingMode;
     Pdb           = clrDump.Eval(() => module.IsFile && module.Pdb != null ? module.Pdb.FileName : null);
 }
Exemplo n.º 15
0
 public override void Init()
 {
     StackFrames = ClrDump.Eval(() => Thread.StackTrace.Select(frame => new StackFrameInformation(ClrDump, frame))).ToList();
 }