2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
17 class AbbreviationTable
;
19 class SourceLanguageInfo
;
22 enum dwarf_unit_kind
{
23 dwarf_unit_kind_compilation
= 0,
30 BaseUnit(off_t headerOffset
,
33 off_t abbreviationOffset
,
34 uint8 addressSize
, bool isDwarf64
);
37 off_t
HeaderOffset() const { return fHeaderOffset
; }
38 off_t
ContentOffset() const { return fContentOffset
; }
39 off_t
RelativeContentOffset() const
40 { return fContentOffset
- fHeaderOffset
; }
41 off_t
TotalSize() const { return fTotalSize
; }
42 off_t
ContentSize() const
44 - RelativeContentOffset(); }
45 off_t
AbbreviationOffset() const
46 { return fAbbreviationOffset
; }
48 bool ContainsAbsoluteOffset(off_t offset
) const;
50 uint8
AddressSize() const { return fAddressSize
; }
51 bool IsDwarf64() const { return fIsDwarf64
; }
53 AbbreviationTable
* GetAbbreviationTable() const
54 { return fAbbreviationTable
; }
55 void SetAbbreviationTable(
56 AbbreviationTable
* abbreviationTable
);
58 const SourceLanguageInfo
* SourceLanguage() const
59 { return fSourceLanguage
; }
60 void SetSourceLanguage(
61 const SourceLanguageInfo
* language
);
63 status_t
AddDebugInfoEntry(DebugInfoEntry
* entry
,
65 int CountEntries() const;
66 void GetEntryAt(int index
, DebugInfoEntry
*& entry
,
68 DebugInfoEntry
* EntryForOffset(off_t offset
) const;
70 virtual dwarf_unit_kind
Kind() const = 0;
76 off_t fAbbreviationOffset
;
77 AbbreviationTable
* fAbbreviationTable
;
78 const SourceLanguageInfo
* fSourceLanguage
;
79 Array
<DebugInfoEntry
*> fEntries
;
80 Array
<off_t
> fEntryOffsets
;