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_DEBUGINFO_DWARF_DWARFDEBUGLOC_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGLOC_H
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
15 #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
23 /// A single location within a location list.
25 /// The beginning address of the instruction range.
27 /// The ending address of the instruction range.
29 /// The location of the variable within the specified range.
30 SmallVector<unsigned char, 4> Loc;
33 /// A list of locations that contain one variable.
35 /// The beginning offset where this location list is stored in the debug_loc
38 /// All the locations in which the variable is stored.
39 SmallVector<Entry, 2> Entries;
42 using LocationLists = SmallVector<LocationList, 4>;
44 /// A list of all the variables in the debug_loc section, each one describing
45 /// the locations in which the variable is stored.
46 LocationLists Locations;
49 /// Print the location lists found within the debug_loc section.
50 void dump(raw_ostream &OS) const;
52 /// Parse the debug_loc section accessible via the 'data' parameter using the
53 /// address size also given in 'data' to interpret the address ranges.
54 void parse(const DWARFDataExtractor &data);
57 class DWARFDebugLocDWO {
61 SmallVector<unsigned char, 4> Loc;
66 SmallVector<Entry, 2> Entries;
69 using LocationLists = SmallVector<LocationList, 4>;
71 LocationLists Locations;
74 void parse(DataExtractor data);
75 void dump(raw_ostream &OS) const;
78 } // end namespace llvm
80 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGLOC_H