本文整理汇总了C++中Frame::GetSymbolContext方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::GetSymbolContext方法的具体用法?C++ Frame::GetSymbolContext怎么用?C++ Frame::GetSymbolContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame::GetSymbolContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sc
bool
Disassembler::Disassemble
(
Debugger &debugger,
const ArchSpec &arch,
const char *plugin_name,
const char *flavor,
const ExecutionContext &exe_ctx,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
uint32_t options,
Stream &strm
)
{
AddressRange range;
Frame *frame = exe_ctx.GetFramePtr();
if (frame)
{
SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextSymbol));
if (sc.function)
{
range = sc.function->GetAddressRange();
}
else if (sc.symbol && sc.symbol->ValueIsAddress())
{
range.GetBaseAddress() = sc.symbol->GetAddress();
range.SetByteSize (sc.symbol->GetByteSize());
}
else
{
range.GetBaseAddress() = frame->GetFrameCodeAddress();
}
if (range.GetBaseAddress().IsValid() && range.GetByteSize() == 0)
range.SetByteSize (DEFAULT_DISASM_BYTE_SIZE);
}
return Disassemble (debugger,
arch,
plugin_name,
flavor,
exe_ctx,
range,
num_instructions,
num_mixed_context_lines,
options,
strm);
}
示例2: new_context
bool
ThreadPlanStepRange::InRange ()
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
bool ret_value = false;
lldb::addr_t pc_load_addr = m_thread.GetRegisterContext()->GetPC();
size_t num_ranges = m_address_ranges.size();
for (size_t i = 0; i < num_ranges; i++)
{
ret_value = m_address_ranges[i].ContainsLoadAddress(pc_load_addr, m_thread.CalculateTarget().get());
if (ret_value)
break;
}
if (!ret_value)
{
// See if we've just stepped to another part of the same line number...
Frame *frame = m_thread.GetStackFrameAtIndex(0).get();
SymbolContext new_context(frame->GetSymbolContext(eSymbolContextEverything));
if (m_addr_context.line_entry.IsValid() && new_context.line_entry.IsValid())
{
if (m_addr_context.line_entry.file == new_context.line_entry.file)
{
if (m_addr_context.line_entry.line == new_context.line_entry.line)
{
m_addr_context = new_context;
AddRange(m_addr_context.line_entry.range);
ret_value = true;
if (log)
{
StreamString s;
m_addr_context.line_entry.Dump (&s,
m_thread.CalculateTarget().get(),
true,
Address::DumpStyleLoadAddress,
Address::DumpStyleLoadAddress,
true);
log->Printf ("Step range plan stepped to another range of same line: %s", s.GetData());
}
}
else if (new_context.line_entry.line == 0)
{
new_context.line_entry.line = m_addr_context.line_entry.line;
m_addr_context = new_context;
AddRange(m_addr_context.line_entry.range);
ret_value = true;
if (log)
{
StreamString s;
m_addr_context.line_entry.Dump (&s,
m_thread.CalculateTarget().get(),
true,
Address::DumpStyleLoadAddress,
Address::DumpStyleLoadAddress,
true);
log->Printf ("Step range plan stepped to a range at linenumber 0 stepping through that range: %s", s.GetData());
}
}
else if (new_context.line_entry.range.GetBaseAddress().GetLoadAddress(m_thread.CalculateTarget().get())
!= pc_load_addr)
{
// Another thing that sometimes happens here is that we step out of one line into the MIDDLE of another
// line. So far I mostly see this due to bugs in the debug information.
// But we probably don't want to be in the middle of a line range, so in that case reset the stepping
// range to the line we've stepped into the middle of and continue.
m_addr_context = new_context;
m_address_ranges.clear();
AddRange(m_addr_context.line_entry.range);
ret_value = true;
if (log)
{
StreamString s;
m_addr_context.line_entry.Dump (&s,
m_thread.CalculateTarget().get(),
true,
Address::DumpStyleLoadAddress,
Address::DumpStyleLoadAddress,
true);
log->Printf ("Step range plan stepped to the middle of new line(%d): %s, continuing to clear this line.",
new_context.line_entry.line,
s.GetData());
}
}
}
}
}
if (!ret_value && log)
log->Printf ("Step range plan out of range to 0x%" PRIx64, pc_load_addr);
return ret_value;
//.........这里部分代码省略.........