DWARFDebugRangeList.h revision eceb5b99777ba944a0ae3748a0371e9a3aa94d56
1eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//===-- DWARFDebugRangeList.h -----------------------------------*- C++ -*-===//
2eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//
3eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//                     The LLVM Compiler Infrastructure
4eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//
5eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov// This file is distributed under the University of Illinois Open Source
6eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov// License. See LICENSE.TXT for details.
7eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//
8eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov//===----------------------------------------------------------------------===//
9eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
10eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov#ifndef LLVM_DEBUGINFO_DWARFDEBUGRANGELIST_H
11eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov#define LLVM_DEBUGINFO_DWARFDEBUGRANGELIST_H
12eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
13eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov#include "llvm/Support/DataExtractor.h"
14eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov#include <vector>
15eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
16eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovnamespace llvm {
17eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
18eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovclass raw_ostream;
19eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
20eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovclass DWARFDebugRangeList {
21eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovpublic:
22eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  struct RangeListEntry {
23eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // A beginning address offset. This address offset has the size of an
24eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // address and is relative to the applicable base address of the
25eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // compilation unit referencing this range list. It marks the beginning
26eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // of an address range.
27eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    uint64_t StartAddress;
28eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // An ending address offset. This address offset again has the size of
29eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // an address and is relative to the applicable base address of the
30eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // compilation unit referencing this range list. It marks the first
31eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // address past the end of the address range. The ending address must
32eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    // be greater than or equal to the beginning address.
33eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov    uint64_t EndAddress;
34eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  };
35eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
36eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovprivate:
37eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  // Offset in .debug_ranges section.
38eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  uint32_t Offset;
39eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  uint8_t AddressSize;
40eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  std::vector<RangeListEntry> Entries;
41eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
42eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonovpublic:
43eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  DWARFDebugRangeList() { clear(); }
44eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  void clear();
45eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  void dump(raw_ostream &OS) const;
46eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov  bool extract(DataExtractor data, uint32_t *offset_ptr);
47eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov};
48eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
49eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov}  // namespace llvm
50eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov
51eceb5b99777ba944a0ae3748a0371e9a3aa94d56Alexey Samsonov#endif  // LLVM_DEBUGINFO_DWARFDEBUGRANGELIST_H
52