LLVM  5.0.0
DWARFDebugLoc.h
Go to the documentation of this file.
1 //===- DWARFDebugLoc.h ------------------------------------------*- 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 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGLOC_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGLOC_H
12 
13 #include "llvm/ADT/SmallVector.h"
16 #include <cstdint>
17 
18 namespace llvm {
19 
20 class raw_ostream;
21 
23  /// A single location within a location list.
24  struct Entry {
25  /// The beginning address of the instruction range.
26  uint64_t Begin;
27  /// The ending address of the instruction range.
28  uint64_t End;
29  /// The location of the variable within the specified range.
31  };
32 
33  /// A list of locations that contain one variable.
34  struct LocationList {
35  /// The beginning offset where this location list is stored in the debug_loc
36  /// section.
37  unsigned Offset;
38  /// All the locations in which the variable is stored.
39  SmallVector<Entry, 2> Entries;
40  };
41 
43 
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;
47 
48 public:
49  /// Print the location lists found within the debug_loc section.
50  void dump(raw_ostream &OS) const;
51 
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);
55 };
56 
58  struct Entry {
59  uint64_t Start;
60  uint32_t Length;
62  };
63 
64  struct LocationList {
65  unsigned Offset;
66  SmallVector<Entry, 2> Entries;
67  };
68 
70 
71  LocationLists Locations;
72 
73 public:
74  void parse(DataExtractor data);
75  void dump(raw_ostream &OS) const;
76 };
77 
78 } // end namespace llvm
79 
80 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGLOC_H
void dump(raw_ostream &OS) const
void parse(DataExtractor data)
static const unsigned End
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
void dump(raw_ostream &OS) const
Print the location lists found within the debug_loc section.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
void parse(const DWARFDataExtractor &data)
Parse the debug_loc section accessible via the 'data' parameter using the address size also given in ...