Example #1
0
        private void versionTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (font != MainForm.instance.font)
            {
                font        = MainForm.instance.font;
                initialized = false;
                GraphPanel_Invalidate();
                typeLegendPanel.Invalidate();
            }

            if (!autoUpdate)
            {
                return;
            }

            ReadLogResult logResult = MainForm.instance.lastLogResult;

            if (logResult != null && logResult.liveObjectTable != liveObjectTable)
            {
                liveObjectTable = logResult.liveObjectTable;
                initialized     = false;
                GraphPanel_Invalidate();
                typeLegendPanel.Invalidate();
            }
        }
 internal ViewByAddressForm(LiveObjectTable liveObjectTable, string title) : this()
 {
     this.liveObjectTable = liveObjectTable;
     typeName = liveObjectTable.readNewLog.typeName;
     autoUpdate = false;
     baseTitle = title;
     Text = title;
 }
Example #3
0
 internal ViewByAddressForm(LiveObjectTable liveObjectTable, string title) : this()
 {
     this.liveObjectTable = liveObjectTable;
     typeName             = liveObjectTable.readNewLog.typeName;
     autoUpdate           = false;
     baseTitle            = title;
     Text = title;
 }
Example #4
0
        private void versionTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            ReadLogResult readLogResult = MainForm.instance.lastLogResult;

            if (autoUpdate && readLogResult != null && readLogResult.liveObjectTable != liveObjectTable)
            {
                liveObjectTable = readLogResult.liveObjectTable;
                graphPanel.Invalidate();
                typeLegendPanel.Invalidate();
            }
        }
        private AddressRange AddressRangeOfObject(ref LiveObjectTable.LiveObject o, AddressRange hint)
        {
            if (hint != null && hint.loAddr <= o.id && o.id < hint.hiAddr)
                return hint;

            return AddressRangeOfObject(ref o);
        }
        private AddressRange AddressRangeOfObject(ref LiveObjectTable.LiveObject o)
        {
            AddressRange r = AddressRangeOf(o.id);
            if (r != null)
                return r;

            Debug.Assert(false);
            rangeList = new AddressRange(o.id, o.id + o.size, rangeList, rangeCount++);

            return rangeList;
        }
        private void versionTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (font != MainForm.instance.font)
            {
                font = MainForm.instance.font;
                initialized = false;
                GraphPanel_Invalidate();
                typeLegendPanel.Invalidate();
            }

            if (!autoUpdate)
                return;

            ReadLogResult logResult = MainForm.instance.lastLogResult;
            if (logResult != null && logResult.liveObjectTable != liveObjectTable)
            {
                liveObjectTable = logResult.liveObjectTable;
                initialized = false;
                GraphPanel_Invalidate();
                typeLegendPanel.Invalidate();
            }
        }
 private bool FindObject(ulong addr, out LiveObjectTable.LiveObject o)
 {
     ulong id = liveObjectTable.FindObjectBackward(addr);
     liveObjectTable.GetNextObject(id, addr + 4, out o);
     return o.id <= addr && addr < o.id + o.size;
 }
        private void graphPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            if (!initialized)
            {
                if (autoUpdate)
                    liveObjectTable = MainForm.instance.lastLogResult.liveObjectTable;

                typeName = liveObjectTable.readNewLog.typeName;

                leftMargin = LeftMargin(g);

                BuildAddressRangesTypeTable();

                ColorTypes();

                gap = (int)g.MeasureString("  gen 0 0123456789", font).Width;

                heapWidth = HeapWidth(rangeCount);

                ulong maxRangeSize = 0;
                for (AddressRange r = rangeList; r != null; r = r.next)
                {
                    ulong rangeSize = r.hiAddr - r.loAddr;
                    if (maxRangeSize < rangeSize)
                        maxRangeSize = rangeSize;
                }

                bytesPerPixel = BytesPerPixel(graphPanel.Height - topMargin - bottomMargin, (int)(maxRangeSize/(uint)heapWidth), bytesPerPixel == 0);
            
                int maxHeight = (int)(maxRangeSize/(uint)(bytesPerPixel*heapWidth));
                int height = topMargin + maxHeight + bottomMargin;
                if (height < minHeight)
                    height = minHeight;
                graphPanel.Height = height;

                int width = leftMargin + rangeCount*(heapWidth + gap) + rightMargin;
                graphPanel.Width = width;

                initialized = true;
            }

            g.SetClip(e.ClipRectangle);

            DrawLiveObjects(g, null, 0, ulong.MaxValue);

            Pen pen = new Pen(Color.Black);
            DrawSelectionHorizontalLine(g, pen, selectedHighAddr);
            DrawSelectionHorizontalLine(g, pen, selectedLowAddr);
            DrawSelectionVerticalLines(g, pen, selectedLowAddr, selectedHighAddr);

            DrawHeapLegend(g);

            DrawGenerationLimits(g);
        }
Example #10
0
 internal IntervalTable(LiveObjectTable liveObjectTable)
 {
     liveRoot = null;
     this.liveObjectTable = liveObjectTable;
 }
Example #11
0
 internal AgeHistogram(LiveObjectTable liveObjectTable, string title) : this()
 {
     this.liveObjectTable = liveObjectTable;
     this.Text = title;
     autoUpdate = false;
 }
Example #12
0
        private void versionTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            ReadLogResult readLogResult = MainForm.instance.lastLogResult;

            if (autoUpdate && readLogResult != null && readLogResult.liveObjectTable != liveObjectTable)
            {
                liveObjectTable = readLogResult.liveObjectTable;
                graphPanel.Invalidate();
                typeLegendPanel.Invalidate();
            }       
        }
 internal IntervalTable(LiveObjectTable liveObjectTable)
 {
     liveRoot             = null;
     this.liveObjectTable = liveObjectTable;
 }
Example #14
0
        private void graphPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            if (!initialized)
            {
                if (autoUpdate)
                {
                    Debug.Assert(MainForm.instance.lastLogResult != null, "MainForm.instance.lastLogResult != null");
                    liveObjectTable = MainForm.instance.lastLogResult.liveObjectTable;
                }

                typeName = liveObjectTable.readNewLog.typeName;

                leftMargin = LeftMargin(g);

                BuildAddressRangesTypeTable();

                ColorTypes();

                gap = (int)g.MeasureString("  gen 0 0123456789", font).Width;

                heapWidth = HeapWidth(rangeCount);

                ulong maxRangeSize = 0;
                for (AddressRange r = rangeList; r != null; r = r.next)
                {
                    ulong rangeSize = r.hiAddr - r.loAddr;
                    if (maxRangeSize < rangeSize)
                    {
                        maxRangeSize = rangeSize;
                    }
                }

                bytesPerPixel = BytesPerPixel(graphPanel.Height - topMargin - bottomMargin, (int)(maxRangeSize / (uint)heapWidth), bytesPerPixel == 0);

                int maxHeight = (int)(maxRangeSize / (uint)(bytesPerPixel * heapWidth));
                int height    = topMargin + maxHeight + bottomMargin;
                if (height < minHeight)
                {
                    height = minHeight;
                }

                graphPanel.Height = height;

                int width = leftMargin + rangeCount * (heapWidth + gap) + rightMargin;
                graphPanel.Width = width;

                initialized = true;
            }

            g.SetClip(e.ClipRectangle);

            DrawLiveObjects(g, null, 0, ulong.MaxValue);

            var pen = new Pen(Color.Black);

            DrawSelectionHorizontalLine(g, pen, selectedHighAddr);
            DrawSelectionHorizontalLine(g, pen, selectedLowAddr);
            DrawSelectionVerticalLines(g, pen, selectedLowAddr, selectedHighAddr);

            DrawHeapLegend(g);

            DrawGenerationLimits(g);
        }
Example #15
0
 internal AgeHistogram(LiveObjectTable liveObjectTable, string title) : this()
 {
     this.liveObjectTable = liveObjectTable;
     this.Text            = title;
     autoUpdate           = false;
 }