本文整理汇总了C++中DWARFCompileUnit::BuildAddressRangeTable方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFCompileUnit::BuildAddressRangeTable方法的具体用法?C++ DWARFCompileUnit::BuildAddressRangeTable怎么用?C++ DWARFCompileUnit::BuildAddressRangeTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFCompileUnit
的用法示例。
在下文中一共展示了DWARFCompileUnit::BuildAddressRangeTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DWARFDebugAranges
DWARFDebugAranges &
DWARFDebugInfo::GetCompileUnitAranges ()
{
if (m_cu_aranges_ap.get() == NULL && m_dwarf2Data)
{
Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
m_cu_aranges_ap.reset (new DWARFDebugAranges());
const DWARFDataExtractor &debug_aranges_data = m_dwarf2Data->get_debug_aranges_data();
if (debug_aranges_data.GetByteSize() > 0)
{
if (log)
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" from .debug_aranges",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
m_cu_aranges_ap->Extract (debug_aranges_data);
}
// Make a list of all CUs represented by the arange data in the file.
std::set<dw_offset_t> cus_with_data;
for (size_t n=0;n<m_cu_aranges_ap.get()->GetNumRanges();n++)
{
dw_offset_t offset = m_cu_aranges_ap.get()->OffsetAtIndex(n);
if (offset != DW_INVALID_OFFSET)
cus_with_data.insert (offset);
}
// Manually build arange data for everything that wasn't in the .debug_aranges table.
bool printed = false;
const size_t num_compile_units = GetNumCompileUnits();
const bool clear_dies_if_already_not_parsed = true;
for (size_t idx = 0; idx < num_compile_units; ++idx)
{
DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx);
dw_offset_t offset = cu->GetOffset();
if (cus_with_data.find(offset) == cus_with_data.end())
{
if (log)
{
if (!printed)
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" by parsing",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
printed = true;
}
cu->BuildAddressRangeTable (m_dwarf2Data, m_cu_aranges_ap.get(), clear_dies_if_already_not_parsed);
}
}
const bool minimize = true;
m_cu_aranges_ap->Sort (minimize);
}
return *m_cu_aranges_ap.get();
}
示例2: Generate
//----------------------------------------------------------------------
// Generate
//----------------------------------------------------------------------
bool DWARFDebugAranges::Generate(SymbolFileDWARF *dwarf2Data) {
Clear();
DWARFDebugInfo *debug_info = dwarf2Data->DebugInfo();
if (debug_info) {
uint32_t cu_idx = 0;
const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits();
for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (cu)
cu->BuildAddressRangeTable(dwarf2Data, this);
}
}
return !IsEmpty();
}
示例3: log
DWARFDebugAranges &
DWARFDebugInfo::GetCompileUnitAranges ()
{
if (m_cu_aranges_ap.get() == NULL && m_dwarf2Data)
{
LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
m_cu_aranges_ap.reset (new DWARFDebugAranges());
const DataExtractor &debug_aranges_data = m_dwarf2Data->get_debug_aranges_data();
if (debug_aranges_data.GetByteSize() > 0)
{
if (log)
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" from .debug_aranges",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
m_cu_aranges_ap->Extract (debug_aranges_data);
}
else
{
if (log)
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" by parsing",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
const uint32_t num_compile_units = GetNumCompileUnits();
uint32_t idx;
const bool clear_dies_if_already_not_parsed = true;
for (idx = 0; idx < num_compile_units; ++idx)
{
DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx);
if (cu)
cu->BuildAddressRangeTable (m_dwarf2Data, m_cu_aranges_ap.get(), clear_dies_if_already_not_parsed);
}
}
const bool minimize = true;
m_cu_aranges_ap->Sort (minimize);
}
return *m_cu_aranges_ap.get();
}