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