xref: /haiku/src/kits/debugger/dwarf/TypeUnit.cpp (revision 3c16ba4e780846dc1973050c97b54d39c2eb854f)
1 /*
2  * Copyright 2013, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 #include "TypeUnit.h"
6 
7 #include <new>
8 
9 #include "DebugInfoEntries.h"
10 
11 
TypeUnit(off_t headerOffset,off_t contentOffset,off_t totalSize,off_t abbreviationOffset,off_t typeOffset,uint8 addressSize,bool isBigEndian,uint64 signature,bool isDwarf64)12 TypeUnit::TypeUnit(off_t headerOffset, off_t contentOffset,
13 	off_t totalSize, off_t abbreviationOffset, off_t typeOffset,
14 	uint8 addressSize, bool isBigEndian, uint64 signature, bool isDwarf64)
15 	:
16 	BaseUnit(headerOffset, contentOffset, totalSize, abbreviationOffset,
17 		addressSize, isBigEndian, isDwarf64),
18 	fUnitEntry(NULL),
19 	fTypeEntry(NULL),
20 	fSignature(signature),
21 	fTypeOffset(typeOffset)
22 {
23 }
24 
25 
~TypeUnit()26 TypeUnit::~TypeUnit()
27 {
28 }
29 
30 
31 void
SetUnitEntry(DIETypeUnit * entry)32 TypeUnit::SetUnitEntry(DIETypeUnit* entry)
33 {
34 	fUnitEntry = entry;
35 }
36 
37 
38 DebugInfoEntry*
TypeEntry() const39 TypeUnit::TypeEntry() const
40 {
41 	return fTypeEntry;
42 }
43 
44 
45 void
SetTypeEntry(DebugInfoEntry * entry)46 TypeUnit::SetTypeEntry(DebugInfoEntry* entry)
47 {
48 	fTypeEntry = entry;
49 }
50 
51 
52 dwarf_unit_kind
Kind() const53 TypeUnit::Kind() const
54 {
55 	return dwarf_unit_kind_type;
56 }
57