bool
DWARFDebugPubnames::Extract(const DWARFDataExtractor& data)
{
    Timer scoped_timer (__PRETTY_FUNCTION__,
                        "DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")",
                        (uint64_t)data.GetByteSize());
    Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES));
    if (log)
        log->Printf("DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")", (uint64_t)data.GetByteSize());

    if (data.ValidOffset(0))
    {
        lldb::offset_t offset = 0;

        DWARFDebugPubnamesSet set;
        while (data.ValidOffset(offset))
        {
            if (set.Extract(data, &offset))
            {
                m_sets.push_back(set);
                offset = set.GetOffsetOfNextEntry();
            }
            else
                break;
        }
        if (log)
            Dump (log);
        return true;
    }
    return false;
}
Example #2
0
void DWARFDebugMacinfo::Dump(Stream *s, const DWARFDataExtractor &macinfo_data,
                             lldb::offset_t offset) {
  DWARFDebugMacinfoEntry maninfo_entry;
  if (macinfo_data.GetByteSize() == 0) {
    s->PutCString("< EMPTY >\n");
    return;
  }
  if (offset == LLDB_INVALID_OFFSET) {
    offset = 0;
    while (maninfo_entry.Extract(macinfo_data, &offset))
      maninfo_entry.Dump(s);
  } else {
    if (maninfo_entry.Extract(macinfo_data, &offset))
      maninfo_entry.Dump(s);
  }
}