1 //===-- DWARFDebugMacinfo.cpp -----------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "DWARFDebugMacinfo.h" 11 12 #include "DWARFDebugMacinfoEntry.h" 13 #include "SymbolFileDWARF.h" 14 15 #include "lldb/Utility/Stream.h" 16 17 using namespace lldb_private; 18 using namespace std; 19 20 DWARFDebugMacinfo::DWARFDebugMacinfo() {} 21 22 DWARFDebugMacinfo::~DWARFDebugMacinfo() {} 23 24 void DWARFDebugMacinfo::Dump(Stream *s, const DWARFDataExtractor &macinfo_data, 25 lldb::offset_t offset) { 26 DWARFDebugMacinfoEntry maninfo_entry; 27 if (macinfo_data.GetByteSize() == 0) { 28 s->PutCString("< EMPTY >\n"); 29 return; 30 } 31 if (offset == LLDB_INVALID_OFFSET) { 32 offset = 0; 33 while (maninfo_entry.Extract(macinfo_data, &offset)) 34 maninfo_entry.Dump(s); 35 } else { 36 if (maninfo_entry.Extract(macinfo_data, &offset)) 37 maninfo_entry.Dump(s); 38 } 39 } 40