77 lines
2.4 KiB
C#
77 lines
2.4 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using UAF.Remoting;
|
|
|
|
namespace MemoryViewer
|
|
{
|
|
public partial class ActorSize : Form
|
|
{
|
|
public ActorSize()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void ActorSize_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
sendCommand("dump_actorsize", null);
|
|
|
|
gridInstance.BorderStyle = BorderStyle.FixedSingle;
|
|
gridInstance.ColumnsCount = 4;
|
|
gridInstance.FixedRows = 1;
|
|
gridInstance.Rows.Insert(0);
|
|
|
|
gridInstance[0, 0] = new SourceGrid.Cells.ColumnHeader("Actor Name");
|
|
gridInstance[0, 1] = new SourceGrid.Cells.ColumnHeader("Class size");
|
|
gridInstance[0, 2] = new SourceGrid.Cells.ColumnHeader("Count");
|
|
gridInstance[0, 3] = new SourceGrid.Cells.ColumnHeader("Global Memory");
|
|
|
|
gridInstance.Columns[0].Width = 300;
|
|
gridInstance.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.None;
|
|
|
|
|
|
gridInstance.Columns[3].Width = 100;
|
|
gridInstance.Columns[3].AutoSizeMode = SourceGrid.AutoSizeMode.None;
|
|
}
|
|
|
|
private void sendCommand(string _command, params object[] args)
|
|
{
|
|
//call back
|
|
callbackAction cbAction = (callbackAction)Tag;
|
|
if (cbAction != null)
|
|
cbAction(GetType().ToString(), _command, args);
|
|
}
|
|
|
|
|
|
public void dump(IBlob _currentBlob)
|
|
{
|
|
uint count = 0;
|
|
_currentBlob.Extract(out count);
|
|
|
|
string name = "";
|
|
uint countInstance = 0;
|
|
|
|
for (int index = 0; index < count; index++)
|
|
{
|
|
_currentBlob.Extract(out name);
|
|
_currentBlob.Extract(out countInstance);
|
|
|
|
uint actorSize = 0;
|
|
|
|
if (countInstance>0)
|
|
{
|
|
_currentBlob.Extract(out actorSize);
|
|
}
|
|
|
|
|
|
int r = index + 1;
|
|
|
|
gridInstance.Rows.Insert(r);
|
|
gridInstance[r, 0] = new SourceGrid.Cells.Cell(name.ToString(), typeof(string));
|
|
gridInstance[r, 1] = new SourceGrid.Cells.Cell(actorSize, typeof(uint));
|
|
gridInstance[r, 2] = new SourceGrid.Cells.Cell(countInstance, typeof(uint));
|
|
gridInstance[r, 3] = new SourceGrid.Cells.Cell(actorSize * countInstance, typeof(uint));
|
|
}
|
|
}
|
|
}
|
|
}
|