本文整理汇总了C++中Symbol::GetByteSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::GetByteSize方法的具体用法?C++ Symbol::GetByteSize怎么用?C++ Symbol::GetByteSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol::GetByteSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
AddressRange range;
StackFrame *frame = m_exe_ctx.GetFramePtr();
if (m_options.frame_line)
{
if (frame == NULL)
{
result.AppendError ("Cannot disassemble around the current line without a selected frame.\n");
result.SetStatus (eReturnStatusFailed);
return false;
}
LineEntry pc_line_entry (frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
if (pc_line_entry.IsValid())
{
range = pc_line_entry.range;
}
else
{
m_options.at_pc = true; // No line entry, so just disassemble around the current pc
m_options.show_mixed = false;
}
}
else if (m_options.current_function)
{
if (frame == NULL)
{
result.AppendError ("Cannot disassemble around the current function without a selected frame.\n");
result.SetStatus (eReturnStatusFailed);
return false;
}
Symbol *symbol = frame->GetSymbolContext(eSymbolContextSymbol).symbol;
if (symbol)
{
range.GetBaseAddress() = symbol->GetAddress();
range.SetByteSize(symbol->GetByteSize());
}
}
// Did the "m_options.frame_line" find a valid range already? If so
// skip the rest...
if (range.GetByteSize() == 0)
{
if (m_options.at_pc)
{
if (frame == NULL)
{
result.AppendError ("Cannot disassemble around the current PC without a selected frame.\n");
result.SetStatus (eReturnStatusFailed);
return false;
}
range.GetBaseAddress() = frame->GetFrameCodeAddress();
if (m_options.num_instructions == 0)
{
// Disassembling at the PC always disassembles some number of instructions (not the whole function).
m_options.num_instructions = DEFAULT_DISASM_NUM_INS;
}
ranges.push_back(range);
}
else
{
range.GetBaseAddress().SetOffset (m_options.start_addr);
if (range.GetBaseAddress().IsValid())
{
if (m_options.end_addr != LLDB_INVALID_ADDRESS)
{
if (m_options.end_addr <= m_options.start_addr)
{