private void dataGridView2_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex >= 0 && e.RowIndex >= 0) { DataGridViewCell cell = dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex]; MemBlock block = dataGridView2.Rows[e.RowIndex].Tag as MemBlock; string ttText = ""; string blockTag = block.GetTagString(); if (blockTag.Length > 0) { ttText = ttText + "Tag: " + blockTag + "\n----------------------\n"; } ulong[] callStack = CallstackTab.GetCallStack(block.m_callStackCRC); for (int i = 0; i < callStack.Length; ++i) { IStackTracer.Symbol symbol = MemTracerForm.ms_MainForm.StackTracer.GetSymbolForAddress(callStack[i]); if (symbol.functionName != null) { ttText = ttText + symbol.functionName + "\n"; } } cell.ToolTipText = ttText; } }
void AddAlloc(MemBlock mb) { string opText = "Alloc: " + mb.m_size + " byte(s) at " + mb.m_address.ToString("X") + " (" + mb.GetTagString() + ")"; treeView1.Nodes.Add(opText); TreeNode n = treeView1.Nodes[treeView1.Nodes.Count - 1]; ulong[] callStack = CallstackTab.GetCallStack(mb.m_callStackCRC); foreach (uint callStackEntry in callStack) { IStackTracer.Symbol symbol = MemTracerForm.ms_MainForm.StackTracer.GetSymbolForAddress(callStackEntry); if (symbol.functionName != null) { n.Nodes.Add(symbol.functionName); n = n.Nodes[n.Nodes.Count - 1]; } } ++m_numAllocated; m_bytesAllocated += mb.m_size; }