本文整理汇总了C#中SymbolInfo.HasChildren方法的典型用法代码示例。如果您正苦于以下问题:C# SymbolInfo.HasChildren方法的具体用法?C# SymbolInfo.HasChildren怎么用?C# SymbolInfo.HasChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolInfo
的用法示例。
在下文中一共展示了SymbolInfo.HasChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowSymbolInfo
void ShowSymbolInfo(SymbolInfo info)
{
dataGridViewSymbolInfo.Rows.Clear();
if (!info.HasChildren())
return;
long cacheLineSize = (long)GetCacheLineSize();
long prevCacheBoundaryOffset = m_prefetchStartOffset;
if (prevCacheBoundaryOffset > (long)info.m_size)
prevCacheBoundaryOffset = (long)info.m_size;
long numCacheLines = 0;
foreach (SymbolInfo child in info.m_children)
{
if (child.m_padding > 0)
{
long paddingOffset = child.m_offset - child.m_padding;
string[] paddingRow = { "Padding", paddingOffset.ToString(), child.m_padding.ToString() };
dataGridViewSymbolInfo.Rows.Add(paddingRow);
}
// long childEndOffset = child.m_offset + (long)child.m_size;
while (child.m_offset - prevCacheBoundaryOffset >= cacheLineSize)
{
numCacheLines = numCacheLines + 1;
long cacheLineOffset = numCacheLines * cacheLineSize + m_prefetchStartOffset;
string[] boundaryRow = { "Cacheline boundary", cacheLineOffset.ToString(), "" };
dataGridViewSymbolInfo.Rows.Add(boundaryRow);
prevCacheBoundaryOffset = cacheLineOffset;
}
string[] row = { child.m_name, child.m_offset.ToString(), child.m_size.ToString() };
dataGridViewSymbolInfo.Rows.Add(row);
dataGridViewSymbolInfo.Rows[dataGridViewSymbolInfo.Rows.Count - 1].Tag = child;
if (child.m_typeName != null && child.m_typeName.Length != 0)
{
dataGridViewSymbolInfo.Rows[dataGridViewSymbolInfo.Rows.Count - 1].Cells[0].ToolTipText = child.m_typeName;
}
}
// Final structure padding.
if (info.m_padding > 0)
{
long paddingOffset = (long)info.m_size - info.m_padding;
string[] paddingRow = { "Padding", paddingOffset.ToString(), info.m_padding.ToString() };
dataGridViewSymbolInfo.Rows.Add(paddingRow);
}
}