1 //===-- DWARFDebugLoc.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_DEBUGINFO_DWARFDEBUGLOC_H
11 #define LLVM_LIB_DEBUGINFO_DWARFDEBUGLOC_H
13 #include "DWARFRelocMap.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/Support/DataExtractor.h"
22 /// A single location within a location list.
24 /// The beginning address of the instruction range.
26 /// The ending address of the instruction range.
28 /// The location of the variable within the specified range.
29 SmallVector<unsigned char, 4> Loc;
32 /// A list of locations that contain one variable.
34 /// The beginning offset where this location list is stored in the debug_loc
37 /// All the locations in which the variable is stored.
38 SmallVector<Entry, 2> Entries;
41 typedef SmallVector<LocationList, 4> LocationLists;
43 /// A list of all the variables in the debug_loc section, each one describing
44 /// the locations in which the variable is stored.
45 LocationLists Locations;
47 /// A map used to resolve binary relocations.
48 const RelocAddrMap &RelocMap;
51 DWARFDebugLoc(const RelocAddrMap &LocRelocMap) : RelocMap(LocRelocMap) {}
52 /// Print the location lists found within the debug_loc section.
53 void dump(raw_ostream &OS) const;
54 /// Parse the debug_loc section accessible via the 'data' parameter using the
55 /// specified address size to interpret the address ranges.
56 void parse(DataExtractor data, unsigned AddressSize);
59 class DWARFDebugLocDWO {
63 SmallVector<unsigned char, 4> Loc;
68 SmallVector<Entry, 2> Entries;
71 typedef SmallVector<LocationList, 4> LocationLists;
73 LocationLists Locations;
76 void parse(DataExtractor data);
77 void dump(raw_ostream &OS) const;