1d054be0dSIngo Weinhold/*
2d054be0dSIngo Weinhold * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3d18be78aSRene Gollent * Copyright 2012-2013, Rene Gollent, rene@gollent.com.
4d054be0dSIngo Weinhold * Distributed under the terms of the MIT License.
5d054be0dSIngo Weinhold */
6d054be0dSIngo Weinhold#ifndef DWARF_TYPES_H
7d054be0dSIngo Weinhold#define DWARF_TYPES_H
8d054be0dSIngo Weinhold
9d054be0dSIngo Weinhold
10d054be0dSIngo Weinhold#include <String.h>
11d054be0dSIngo Weinhold
12d054be0dSIngo Weinhold#include <ObjectList.h>
13d054be0dSIngo Weinhold#include <Referenceable.h>
14d054be0dSIngo Weinhold
15d054be0dSIngo Weinhold#include "Type.h"
16d054be0dSIngo Weinhold
17d054be0dSIngo Weinhold
18d054be0dSIngo Weinholdclass Architecture;
19d054be0dSIngo Weinholdclass CompilationUnit;
20ada60b4eSRene Gollentclass DebugInfoEntry;
21d054be0dSIngo Weinholdclass DIEAddressingType;
22d054be0dSIngo Weinholdclass DIEArrayType;
23d054be0dSIngo Weinholdclass DIEBaseType;
24d054be0dSIngo Weinholdclass DIECompoundType;
25d054be0dSIngo Weinholdclass DIEEnumerationType;
26d054be0dSIngo Weinholdclass DIEEnumerator;
27d054be0dSIngo Weinholdclass DIEFormalParameter;
28d054be0dSIngo Weinholdclass DIEInheritance;
29d054be0dSIngo Weinholdclass DIEMember;
30d054be0dSIngo Weinholdclass DIEModifiedType;
31d054be0dSIngo Weinholdclass DIEPointerToMemberType;
32d054be0dSIngo Weinholdclass DIESubprogram;
33d054be0dSIngo Weinholdclass DIESubrangeType;
34d054be0dSIngo Weinholdclass DIESubroutineType;
35d054be0dSIngo Weinholdclass DIEType;
36d054be0dSIngo Weinholdclass DIETypedef;
37d054be0dSIngo Weinholdclass DIEUnspecifiedType;
38d054be0dSIngo Weinholdclass DwarfFile;
39d054be0dSIngo Weinholdclass DwarfTargetInterface;
40d054be0dSIngo Weinholdstruct LocationDescription;
41d054be0dSIngo Weinholdstruct MemberLocation;
42d054be0dSIngo Weinholdclass RegisterMap;
43d054be0dSIngo Weinholdclass ValueLocation;
44d054be0dSIngo Weinhold
45d054be0dSIngo Weinhold
46185d2cdcSRene Gollent// conversion functions between model types and dwarf types
47185d2cdcSRene Gollenttype_kind dwarf_tag_to_type_kind(int32 tag);
48185d2cdcSRene Gollentint32 dwarf_tag_to_subtype_kind(int32 tag);
49185d2cdcSRene Gollent
50185d2cdcSRene Gollent
51d054be0dSIngo Weinholdclass DwarfTypeContext : public BReferenceable {
52d054be0dSIngo Weinholdpublic:
53d054be0dSIngo Weinhold								DwarfTypeContext(Architecture* architecture,
54d054be0dSIngo Weinhold									image_id imageID, DwarfFile* file,
55d054be0dSIngo Weinhold									CompilationUnit* compilationUnit,
56d054be0dSIngo Weinhold									DIESubprogram* subprogramEntry,
57d054be0dSIngo Weinhold									target_addr_t instructionPointer,
58d054be0dSIngo Weinhold									target_addr_t framePointer,
593a1ce93bSRene Gollent									target_addr_t relocationDelta,
60d054be0dSIngo Weinhold									DwarfTargetInterface* targetInterface,
61d054be0dSIngo Weinhold									RegisterMap* fromDwarfRegisterMap);
62d054be0dSIngo Weinhold								~DwarfTypeContext();
63d054be0dSIngo Weinhold
64d054be0dSIngo Weinhold			Architecture*		GetArchitecture() const
65d054be0dSIngo Weinhold									{ return fArchitecture; }
66d054be0dSIngo Weinhold			image_id			ImageID() const
67d054be0dSIngo Weinhold									{ return fImageID; }
68d054be0dSIngo Weinhold			DwarfFile*			File() const
69d054be0dSIngo Weinhold									{ return fFile; }
70d054be0dSIngo Weinhold			CompilationUnit*	GetCompilationUnit() const
71d054be0dSIngo Weinhold									{ return fCompilationUnit; }
72d054be0dSIngo Weinhold			DIESubprogram*		SubprogramEntry() const
73d054be0dSIngo Weinhold									{ return fSubprogramEntry; }
74d054be0dSIngo Weinhold			target_addr_t		InstructionPointer() const
75d054be0dSIngo Weinhold									{ return fInstructionPointer; }
76d054be0dSIngo Weinhold			target_addr_t		FramePointer() const
77d054be0dSIngo Weinhold									{ return fFramePointer; }
783a1ce93bSRene Gollent			target_addr_t		RelocationDelta() const
793a1ce93bSRene Gollent									{ return fRelocationDelta; }
80d054be0dSIngo Weinhold			DwarfTargetInterface* TargetInterface() const
81d054be0dSIngo Weinhold									{ return fTargetInterface; }
82d054be0dSIngo Weinhold			RegisterMap*		FromDwarfRegisterMap() const
83d054be0dSIngo Weinhold									{ return fFromDwarfRegisterMap; }
8416b8573bSRene Gollent			uint8			AddressSize() const;
85d054be0dSIngo Weinhold
86d054be0dSIngo Weinholdprivate:
87d054be0dSIngo Weinhold			Architecture*		fArchitecture;
88d054be0dSIngo Weinhold			image_id			fImageID;
89d054be0dSIngo Weinhold			DwarfFile*			fFile;
90d054be0dSIngo Weinhold			CompilationUnit*	fCompilationUnit;
91d054be0dSIngo Weinhold			DIESubprogram*		fSubprogramEntry;
92d054be0dSIngo Weinhold			target_addr_t		fInstructionPointer;
93d054be0dSIngo Weinhold			target_addr_t		fFramePointer;
943a1ce93bSRene Gollent			target_addr_t		fRelocationDelta;
95d054be0dSIngo Weinhold			DwarfTargetInterface* fTargetInterface;
96d054be0dSIngo Weinhold			RegisterMap*		fFromDwarfRegisterMap;
97d054be0dSIngo Weinhold};
98d054be0dSIngo Weinhold
99d054be0dSIngo Weinhold
100d054be0dSIngo Weinholdclass DwarfType : public virtual Type {
101d054be0dSIngo Weinholdpublic:
102d054be0dSIngo Weinhold								DwarfType(DwarfTypeContext* typeContext,
10359ea286fSIngo Weinhold									const BString& name, const DIEType* entry);
104d054be0dSIngo Weinhold								~DwarfType();
105d054be0dSIngo Weinhold
10659ea286fSIngo Weinhold	static	bool				GetTypeID(const DIEType* entry, BString& _id);
10759ea286fSIngo Weinhold
108d054be0dSIngo Weinhold	virtual	image_id			ImageID() const;
10959ea286fSIngo Weinhold	virtual	const BString&		ID() const;
11059ea286fSIngo Weinhold	virtual	const BString&		Name() const;
111d054be0dSIngo Weinhold	virtual	target_size_t		ByteSize() const;
112d054be0dSIngo Weinhold
113ab7a2ea8SRene Gollent	virtual status_t			CreateDerivedAddressType(
114ab7a2ea8SRene Gollent									address_type_kind kind,
115ab7a2ea8SRene Gollent									AddressType*& _resultType);
116ab7a2ea8SRene Gollent
117d18be78aSRene Gollent	virtual	status_t			CreateDerivedArrayType(
118d1251942SRene Gollent									int64 lowerBound,
119d1251942SRene Gollent									int64 elementCount,
120d18be78aSRene Gollent									bool extendExisting,
121d18be78aSRene Gollent									ArrayType*& _resultType);
122d18be78aSRene Gollent
123d054be0dSIngo Weinhold	virtual	status_t			ResolveObjectDataLocation(
124d054be0dSIngo Weinhold									const ValueLocation& objectLocation,
125d054be0dSIngo Weinhold									ValueLocation*& _location);
126d054be0dSIngo Weinhold	virtual	status_t			ResolveObjectDataLocation(
127d054be0dSIngo Weinhold									target_addr_t objectAddress,
128d054be0dSIngo Weinhold									ValueLocation*& _location);
129d054be0dSIngo Weinhold
130d054be0dSIngo Weinhold			DwarfTypeContext*	TypeContext() const
131d054be0dSIngo Weinhold									{ return fTypeContext; }
132d054be0dSIngo Weinhold
133d054be0dSIngo Weinhold			void				SetByteSize(target_size_t size)
134d054be0dSIngo Weinhold									{ fByteSize = size; }
135d054be0dSIngo Weinhold
136d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const = 0;
137d054be0dSIngo Weinhold
138d054be0dSIngo Weinhold			status_t			ResolveLocation(DwarfTypeContext* typeContext,
139d054be0dSIngo Weinhold									const LocationDescription* description,
140d054be0dSIngo Weinhold									target_addr_t objectAddress,
1410573015dSRene Gollent									bool hasObjectAddress,
142d054be0dSIngo Weinhold									ValueLocation& _location);
143d054be0dSIngo Weinhold
144d054be0dSIngo Weinholdprivate:
145d054be0dSIngo Weinhold			DwarfTypeContext*	fTypeContext;
146d054be0dSIngo Weinhold			BString				fName;
14759ea286fSIngo Weinhold			BString				fID;
148d054be0dSIngo Weinhold			target_size_t		fByteSize;
149d054be0dSIngo Weinhold};
150d054be0dSIngo Weinhold
151d054be0dSIngo Weinhold
152d054be0dSIngo Weinholdclass DwarfInheritance : public BaseType {
153d054be0dSIngo Weinholdpublic:
154d054be0dSIngo Weinhold								DwarfInheritance(DIEInheritance* entry,
155d054be0dSIngo Weinhold									DwarfType* type);
156d054be0dSIngo Weinhold								~DwarfInheritance();
157d054be0dSIngo Weinhold
158d054be0dSIngo Weinhold	virtual	Type*				GetType() const;
159d054be0dSIngo Weinhold
160d054be0dSIngo Weinhold			DwarfType*			GetDwarfType() const
161d054be0dSIngo Weinhold									{ return fType; }
162d054be0dSIngo Weinhold			DIEInheritance*		Entry() const
163d054be0dSIngo Weinhold									{ return fEntry; }
164d054be0dSIngo Weinhold
165d054be0dSIngo Weinholdprivate:
166d054be0dSIngo Weinhold			DIEInheritance*		fEntry;
167d054be0dSIngo Weinhold			DwarfType*			fType;
168d054be0dSIngo Weinhold};
169d054be0dSIngo Weinhold
170d054be0dSIngo Weinhold
171d054be0dSIngo Weinholdclass DwarfDataMember : public DataMember {
172d054be0dSIngo Weinholdpublic:
173d054be0dSIngo Weinhold								DwarfDataMember(DIEMember* entry,
174d054be0dSIngo Weinhold									const BString& name, DwarfType* type);
175d054be0dSIngo Weinhold								~DwarfDataMember();
176d054be0dSIngo Weinhold
177d054be0dSIngo Weinhold	virtual	const char*			Name() const;
178d054be0dSIngo Weinhold	virtual	Type*				GetType() const;
179d054be0dSIngo Weinhold
180d054be0dSIngo Weinhold			DwarfType*			GetDwarfType() const
181d054be0dSIngo Weinhold									{ return fType; }
182d054be0dSIngo Weinhold			DIEMember*			Entry() const
183d054be0dSIngo Weinhold									{ return fEntry; }
184d054be0dSIngo Weinhold
185d054be0dSIngo Weinholdprivate:
186d054be0dSIngo Weinhold			DIEMember*			fEntry;
187d054be0dSIngo Weinhold			BString				fName;
188d054be0dSIngo Weinhold			DwarfType*			fType;
189d054be0dSIngo Weinhold};
190d054be0dSIngo Weinhold
191d054be0dSIngo Weinhold
19259ea286fSIngo Weinholdclass DwarfEnumeratorValue : public EnumeratorValue {
193d054be0dSIngo Weinholdpublic:
19459ea286fSIngo Weinhold								DwarfEnumeratorValue(DIEEnumerator* entry,
195d054be0dSIngo Weinhold									const BString& name, const BVariant& value);
19659ea286fSIngo Weinhold								~DwarfEnumeratorValue();
197d054be0dSIngo Weinhold
198d054be0dSIngo Weinhold	virtual	const char*			Name() const;
199d054be0dSIngo Weinhold	virtual	BVariant			Value() const;
200d054be0dSIngo Weinhold
201d054be0dSIngo Weinhold			DIEEnumerator*		Entry() const
202d054be0dSIngo Weinhold									{ return fEntry; }
203d054be0dSIngo Weinhold
204d054be0dSIngo Weinholdprivate:
205d054be0dSIngo Weinhold			DIEEnumerator*		fEntry;
206d054be0dSIngo Weinhold			BString				fName;
207d054be0dSIngo Weinhold			BVariant			fValue;
208d054be0dSIngo Weinhold};
209d054be0dSIngo Weinhold
210d054be0dSIngo Weinhold
211d054be0dSIngo Weinholdclass DwarfArrayDimension : public ArrayDimension {
212d054be0dSIngo Weinholdpublic:
213d054be0dSIngo Weinhold								DwarfArrayDimension(DwarfType* type);
214d054be0dSIngo Weinhold								~DwarfArrayDimension();
215d054be0dSIngo Weinhold
216d054be0dSIngo Weinhold	virtual	Type*				GetType() const;
217d054be0dSIngo Weinhold
218d054be0dSIngo Weinhold			DwarfType*			GetDwarfType() const
219d054be0dSIngo Weinhold									{ return fType; }
220d054be0dSIngo Weinhold
221d054be0dSIngo Weinholdprivate:
222d054be0dSIngo Weinhold			DwarfType*			fType;
223d054be0dSIngo Weinhold
224d054be0dSIngo Weinhold};
225d054be0dSIngo Weinhold
226d054be0dSIngo Weinhold
227d054be0dSIngo Weinholdclass DwarfFunctionParameter : public FunctionParameter {
228d054be0dSIngo Weinholdpublic:
229d054be0dSIngo Weinhold								DwarfFunctionParameter(
230d054be0dSIngo Weinhold									DIEFormalParameter* entry,
231d054be0dSIngo Weinhold									const BString& name, DwarfType* type);
232d054be0dSIngo Weinhold								~DwarfFunctionParameter();
233d054be0dSIngo Weinhold
234d054be0dSIngo Weinhold	virtual	const char*			Name() const;
235d054be0dSIngo Weinhold	virtual	Type*				GetType() const;
236d054be0dSIngo Weinhold
237d054be0dSIngo Weinhold			DIEFormalParameter*	Entry() const
238d054be0dSIngo Weinhold									{ return fEntry; }
239d054be0dSIngo Weinhold
240d054be0dSIngo Weinholdprivate:
241d054be0dSIngo Weinhold			DIEFormalParameter*	fEntry;
242d054be0dSIngo Weinhold			BString				fName;
243d054be0dSIngo Weinhold			DwarfType*			fType;
244d054be0dSIngo Weinhold
245d054be0dSIngo Weinhold};
246d054be0dSIngo Weinhold
247d054be0dSIngo Weinhold
248ada60b4eSRene Gollentclass DwarfTemplateParameter : public TemplateParameter {
249ada60b4eSRene Gollentpublic:
250ada60b4eSRene Gollent								DwarfTemplateParameter(
251ada60b4eSRene Gollent									DebugInfoEntry* entry,
252ada60b4eSRene Gollent									DwarfType* type);
253ada60b4eSRene Gollent								~DwarfTemplateParameter();
254ada60b4eSRene Gollent
255ada60b4eSRene Gollent	virtual	template_type_kind	Kind() const { return fTemplateKind; }
256ada60b4eSRene Gollent	virtual	Type*				GetType() const { return fType; }
257ada60b4eSRene Gollent	virtual BVariant			Value() const { return fValue; }
258ada60b4eSRene Gollent
259ada60b4eSRene Gollentprivate:
260ada60b4eSRene Gollent			DebugInfoEntry*		fEntry;
261ada60b4eSRene Gollent			template_type_kind	fTemplateKind;
262ada60b4eSRene Gollent			Type*				fType;
263ada60b4eSRene Gollent			BVariant			fValue;
264ada60b4eSRene Gollent};
265ada60b4eSRene Gollent
266ada60b4eSRene Gollent
267d054be0dSIngo Weinholdclass DwarfPrimitiveType : public PrimitiveType, public DwarfType {
268d054be0dSIngo Weinholdpublic:
269d054be0dSIngo Weinhold								DwarfPrimitiveType(
270d054be0dSIngo Weinhold									DwarfTypeContext* typeContext,
271d054be0dSIngo Weinhold									const BString& name, DIEBaseType* entry,
272d054be0dSIngo Weinhold									uint32 typeConstant);
273d054be0dSIngo Weinhold
274d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
275d054be0dSIngo Weinhold	virtual	uint32				TypeConstant() const;
276d054be0dSIngo Weinhold
277d054be0dSIngo Weinhold			DIEBaseType*		Entry() const
278d054be0dSIngo Weinhold									{ return fEntry; }
279d054be0dSIngo Weinhold
280d054be0dSIngo Weinholdprivate:
281d054be0dSIngo Weinhold			DIEBaseType*		fEntry;
282d054be0dSIngo Weinhold			uint32				fTypeConstant;
283d054be0dSIngo Weinhold};
284d054be0dSIngo Weinhold
285d054be0dSIngo Weinhold
286d054be0dSIngo Weinholdclass DwarfCompoundType : public CompoundType, public DwarfType {
287d054be0dSIngo Weinholdpublic:
288d054be0dSIngo Weinhold								DwarfCompoundType(DwarfTypeContext* typeContext,
289be63c912SRene Gollent									const BString& name, DIECompoundType* entry,
290be63c912SRene Gollent									compound_type_kind compoundKind);
291d054be0dSIngo Weinhold								~DwarfCompoundType();
292d054be0dSIngo Weinhold
293be63c912SRene Gollent	virtual	compound_type_kind	CompoundKind() const;
294be63c912SRene Gollent
295d054be0dSIngo Weinhold	virtual	int32				CountBaseTypes() const;
296d054be0dSIngo Weinhold	virtual	BaseType*			BaseTypeAt(int32 index) const;
297d054be0dSIngo Weinhold
298d054be0dSIngo Weinhold	virtual	int32				CountDataMembers() const;
299d054be0dSIngo Weinhold	virtual	DataMember*			DataMemberAt(int32 index) const;
300d054be0dSIngo Weinhold
301ada60b4eSRene Gollent	virtual int32				CountTemplateParameters() const;
302ada60b4eSRene Gollent	virtual TemplateParameter*	TemplateParameterAt(int32 index) const;
303ce6b908eSRene Gollent
304d054be0dSIngo Weinhold	virtual	status_t			ResolveBaseTypeLocation(BaseType* _baseType,
305d054be0dSIngo Weinhold									const ValueLocation& parentLocation,
306d054be0dSIngo Weinhold									ValueLocation*& _location);
307d054be0dSIngo Weinhold	virtual	status_t			ResolveDataMemberLocation(DataMember* _member,
308d054be0dSIngo Weinhold									const ValueLocation& parentLocation,
309d054be0dSIngo Weinhold									ValueLocation*& _location);
310d054be0dSIngo Weinhold
311d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
312d054be0dSIngo Weinhold
313d054be0dSIngo Weinhold			DIECompoundType*	Entry() const
314d054be0dSIngo Weinhold									{ return fEntry; }
315d054be0dSIngo Weinhold
316d054be0dSIngo Weinhold			bool				AddInheritance(DwarfInheritance* inheritance);
317d054be0dSIngo Weinhold			bool				AddDataMember(DwarfDataMember* member);
318ada60b4eSRene Gollent			bool				AddTemplateParameter(
319ada60b4eSRene Gollent									DwarfTemplateParameter* parameter);
320d054be0dSIngo Weinhold
321d054be0dSIngo Weinholdprivate:
322d054be0dSIngo Weinhold			typedef BObjectList<DwarfDataMember> DataMemberList;
323d054be0dSIngo Weinhold			typedef BObjectList<DwarfInheritance> InheritanceList;
324ada60b4eSRene Gollent			typedef BObjectList<DwarfTemplateParameter> TemplateParameterList;
325d054be0dSIngo Weinhold
326d054be0dSIngo Weinholdprivate:
327d054be0dSIngo Weinhold			status_t			_ResolveDataMemberLocation(
328d054be0dSIngo Weinhold									DwarfType* memberType,
329d054be0dSIngo Weinhold									const MemberLocation* memberLocation,
330d054be0dSIngo Weinhold									const ValueLocation& parentLocation,
33149093da7SRene Gollent									bool isBitField,
332d054be0dSIngo Weinhold									ValueLocation*& _location);
333d054be0dSIngo Weinhold
334d054be0dSIngo Weinholdprivate:
335be63c912SRene Gollent			compound_type_kind	fCompoundKind;
336d054be0dSIngo Weinhold			DIECompoundType*	fEntry;
337d054be0dSIngo Weinhold			InheritanceList		fInheritances;
338d054be0dSIngo Weinhold			DataMemberList		fDataMembers;
339ada60b4eSRene Gollent			TemplateParameterList fTemplateParameters;
340d054be0dSIngo Weinhold};
341d054be0dSIngo Weinhold
342d054be0dSIngo Weinhold
343d054be0dSIngo Weinholdclass DwarfArrayType : public ArrayType, public DwarfType {
344d054be0dSIngo Weinholdpublic:
345d054be0dSIngo Weinhold								DwarfArrayType(DwarfTypeContext* typeContext,
346d054be0dSIngo Weinhold									const BString& name, DIEArrayType* entry,
347d054be0dSIngo Weinhold									DwarfType* baseType);
348d054be0dSIngo Weinhold								~DwarfArrayType();
349d054be0dSIngo Weinhold
350d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
351d054be0dSIngo Weinhold
352d054be0dSIngo Weinhold	virtual	int32				CountDimensions() const;
353d054be0dSIngo Weinhold	virtual	ArrayDimension*		DimensionAt(int32 index) const;
354d054be0dSIngo Weinhold
355d054be0dSIngo Weinhold	virtual	status_t			ResolveElementLocation(
356d054be0dSIngo Weinhold									const ArrayIndexPath& indexPath,
357d054be0dSIngo Weinhold									const ValueLocation& parentLocation,
358d054be0dSIngo Weinhold									ValueLocation*& _location);
359d054be0dSIngo Weinhold
360d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
361d054be0dSIngo Weinhold
362d054be0dSIngo Weinhold			bool				AddDimension(DwarfArrayDimension* dimension);
363d054be0dSIngo Weinhold
364d054be0dSIngo Weinhold			DwarfArrayDimension* DwarfDimensionAt(int32 index) const
365d054be0dSIngo Weinhold									{ return fDimensions.ItemAt(index); }
366d054be0dSIngo Weinhold			DIEArrayType*		Entry() const
367d054be0dSIngo Weinhold									{ return fEntry; }
368d054be0dSIngo Weinhold
369d054be0dSIngo Weinholdprivate:
370d054be0dSIngo Weinhold			typedef BObjectList<DwarfArrayDimension> DimensionList;
371d054be0dSIngo Weinhold
372d054be0dSIngo Weinholdprivate:
373d054be0dSIngo Weinhold			DIEArrayType*		fEntry;
374d054be0dSIngo Weinhold			DwarfType*			fBaseType;
375d054be0dSIngo Weinhold			DimensionList		fDimensions;
376d054be0dSIngo Weinhold};
377d054be0dSIngo Weinhold
378d054be0dSIngo Weinhold
379d054be0dSIngo Weinholdclass DwarfModifiedType : public ModifiedType, public DwarfType {
380d054be0dSIngo Weinholdpublic:
381d054be0dSIngo Weinhold								DwarfModifiedType(DwarfTypeContext* typeContext,
382d054be0dSIngo Weinhold									const BString& name, DIEModifiedType* entry,
383d054be0dSIngo Weinhold									uint32 modifiers, DwarfType* baseType);
384d054be0dSIngo Weinhold								~DwarfModifiedType();
385d054be0dSIngo Weinhold
386d054be0dSIngo Weinhold	virtual	uint32				Modifiers() const;
387d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
388d054be0dSIngo Weinhold
389d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
390d054be0dSIngo Weinhold
391d054be0dSIngo Weinhold			DIEModifiedType*	Entry() const
392d054be0dSIngo Weinhold									{ return fEntry; }
393d054be0dSIngo Weinhold
394d054be0dSIngo Weinholdprivate:
395d054be0dSIngo Weinhold			DIEModifiedType*	fEntry;
396d054be0dSIngo Weinhold			uint32				fModifiers;
397d054be0dSIngo Weinhold			DwarfType*			fBaseType;
398d054be0dSIngo Weinhold};
399d054be0dSIngo Weinhold
400d054be0dSIngo Weinhold
401d054be0dSIngo Weinholdclass DwarfTypedefType : public TypedefType, public DwarfType {
402d054be0dSIngo Weinholdpublic:
403d054be0dSIngo Weinhold								DwarfTypedefType(DwarfTypeContext* typeContext,
404d054be0dSIngo Weinhold									const BString& name, DIETypedef* entry,
405d054be0dSIngo Weinhold									DwarfType* baseType);
406d054be0dSIngo Weinhold								~DwarfTypedefType();
407d054be0dSIngo Weinhold
408d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
409d054be0dSIngo Weinhold
410d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
411d054be0dSIngo Weinhold
412d054be0dSIngo Weinhold			DIETypedef*			Entry() const
413d054be0dSIngo Weinhold									{ return fEntry; }
414d054be0dSIngo Weinhold
415d054be0dSIngo Weinholdprivate:
416d054be0dSIngo Weinhold			DIETypedef*			fEntry;
417d054be0dSIngo Weinhold			DwarfType*			fBaseType;
418d054be0dSIngo Weinhold};
419d054be0dSIngo Weinhold
420d054be0dSIngo Weinhold
421d054be0dSIngo Weinholdclass DwarfAddressType : public AddressType, public DwarfType {
422d054be0dSIngo Weinholdpublic:
423d054be0dSIngo Weinhold								DwarfAddressType(DwarfTypeContext* typeContext,
424d054be0dSIngo Weinhold									const BString& name,
425d054be0dSIngo Weinhold									DIEAddressingType* entry,
426d054be0dSIngo Weinhold									address_type_kind addressKind,
427d054be0dSIngo Weinhold									DwarfType* baseType);
428d054be0dSIngo Weinhold								~DwarfAddressType();
429d054be0dSIngo Weinhold
430d054be0dSIngo Weinhold	virtual	address_type_kind	AddressKind() const;
431d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
432d054be0dSIngo Weinhold
433d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
434d054be0dSIngo Weinhold
435d054be0dSIngo Weinhold			DIEAddressingType*	Entry() const
436d054be0dSIngo Weinhold									{ return fEntry; }
437d054be0dSIngo Weinhold
438d054be0dSIngo Weinholdprivate:
439d054be0dSIngo Weinhold			DIEAddressingType*	fEntry;
440d054be0dSIngo Weinhold			address_type_kind	fAddressKind;
441d054be0dSIngo Weinhold			DwarfType*			fBaseType;
442d054be0dSIngo Weinhold};
443d054be0dSIngo Weinhold
444d054be0dSIngo Weinhold
445d054be0dSIngo Weinholdclass DwarfEnumerationType : public EnumerationType, public DwarfType {
446d054be0dSIngo Weinholdpublic:
447d054be0dSIngo Weinhold								DwarfEnumerationType(
448d054be0dSIngo Weinhold									DwarfTypeContext* typeContext,
449d054be0dSIngo Weinhold									const BString& name,
450d054be0dSIngo Weinhold									DIEEnumerationType* entry,
451d054be0dSIngo Weinhold									DwarfType* baseType);
452d054be0dSIngo Weinhold								~DwarfEnumerationType();
453d054be0dSIngo Weinhold
454d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
455d054be0dSIngo Weinhold
456d054be0dSIngo Weinhold	virtual	int32				CountValues() const;
45759ea286fSIngo Weinhold	virtual	EnumeratorValue*	ValueAt(int32 index) const;
458d054be0dSIngo Weinhold
459d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
460d054be0dSIngo Weinhold
46159ea286fSIngo Weinhold			bool				AddValue(DwarfEnumeratorValue* value);
462d054be0dSIngo Weinhold
463d054be0dSIngo Weinhold			DIEEnumerationType*	Entry() const
464d054be0dSIngo Weinhold									{ return fEntry; }
465d054be0dSIngo Weinhold
466d054be0dSIngo Weinholdprivate:
46759ea286fSIngo Weinhold			typedef BObjectList<DwarfEnumeratorValue> ValueList;
468d054be0dSIngo Weinhold
469d054be0dSIngo Weinholdprivate:
470d054be0dSIngo Weinhold			DIEEnumerationType*	fEntry;
471d054be0dSIngo Weinhold			DwarfType*			fBaseType;
472d054be0dSIngo Weinhold			ValueList			fValues;
473d054be0dSIngo Weinhold};
474d054be0dSIngo Weinhold
475d054be0dSIngo Weinhold
476d054be0dSIngo Weinholdclass DwarfSubrangeType : public SubrangeType, public DwarfType {
477d054be0dSIngo Weinholdpublic:
478d054be0dSIngo Weinhold								DwarfSubrangeType(DwarfTypeContext* typeContext,
479d054be0dSIngo Weinhold									const BString& name, DIESubrangeType* entry,
480e438c2d7SIngo Weinhold									Type* baseType,
481d054be0dSIngo Weinhold									const BVariant& lowerBound,
482d054be0dSIngo Weinhold									const BVariant& upperBound);
483d054be0dSIngo Weinhold								~DwarfSubrangeType();
484d054be0dSIngo Weinhold
485d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
486d054be0dSIngo Weinhold
487d054be0dSIngo Weinhold	virtual	BVariant			LowerBound() const;
488d054be0dSIngo Weinhold	virtual	BVariant			UpperBound() const;
489d054be0dSIngo Weinhold
490d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
491d054be0dSIngo Weinhold
492d054be0dSIngo Weinhold			DIESubrangeType*	Entry() const
493d054be0dSIngo Weinhold									{ return fEntry; }
494d054be0dSIngo Weinhold
495d054be0dSIngo Weinholdprivate:
496d054be0dSIngo Weinhold			DIESubrangeType*	fEntry;
497e438c2d7SIngo Weinhold			Type*				fBaseType;
498d054be0dSIngo Weinhold			BVariant			fLowerBound;
499d054be0dSIngo Weinhold			BVariant			fUpperBound;
500d054be0dSIngo Weinhold};
501d054be0dSIngo Weinhold
502d054be0dSIngo Weinhold
503d054be0dSIngo Weinholdstruct DwarfUnspecifiedType : public UnspecifiedType, public DwarfType {
504d054be0dSIngo Weinholdpublic:
505d054be0dSIngo Weinhold								DwarfUnspecifiedType(
506d054be0dSIngo Weinhold									DwarfTypeContext* typeContext,
507d054be0dSIngo Weinhold									const BString& name,
508d054be0dSIngo Weinhold									DIEUnspecifiedType* entry);
509d054be0dSIngo Weinhold									// entry may be NULL
510d054be0dSIngo Weinhold								~DwarfUnspecifiedType();
511d054be0dSIngo Weinhold
512d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
513d054be0dSIngo Weinhold
514d054be0dSIngo Weinhold			DIEUnspecifiedType*	Entry() const
515d054be0dSIngo Weinhold									{ return fEntry; }
516d054be0dSIngo Weinhold
517d054be0dSIngo Weinholdprivate:
518d054be0dSIngo Weinhold			DIEUnspecifiedType*	fEntry;
519d054be0dSIngo Weinhold};
520d054be0dSIngo Weinhold
521d054be0dSIngo Weinhold
522d054be0dSIngo Weinholdclass DwarfFunctionType : public FunctionType, public DwarfType {
523d054be0dSIngo Weinholdpublic:
524d054be0dSIngo Weinhold								DwarfFunctionType(DwarfTypeContext* typeContext,
525d054be0dSIngo Weinhold									const BString& name,
526d054be0dSIngo Weinhold									DIESubroutineType* entry,
527d054be0dSIngo Weinhold									DwarfType* returnType);
528d054be0dSIngo Weinhold								~DwarfFunctionType();
529d054be0dSIngo Weinhold
530d054be0dSIngo Weinhold	virtual	Type*				ReturnType() const;
531d054be0dSIngo Weinhold
532d054be0dSIngo Weinhold	virtual	int32				CountParameters() const;
533d054be0dSIngo Weinhold	virtual	FunctionParameter*	ParameterAt(int32 index) const;
534d054be0dSIngo Weinhold
535d054be0dSIngo Weinhold	virtual	bool				HasVariableArguments() const;
536d054be0dSIngo Weinhold			void				SetHasVariableArguments(bool hasVarArgs);
537d054be0dSIngo Weinhold
538d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
539d054be0dSIngo Weinhold
540d054be0dSIngo Weinhold			bool				AddParameter(DwarfFunctionParameter* parameter);
541d054be0dSIngo Weinhold
542d054be0dSIngo Weinhold			DwarfFunctionParameter* DwarfParameterAt(int32 index) const
543d054be0dSIngo Weinhold									{ return fParameters.ItemAt(index); }
544d054be0dSIngo Weinhold
545d054be0dSIngo Weinhold			DIESubroutineType*	Entry() const
546d054be0dSIngo Weinhold									{ return fEntry; }
547d054be0dSIngo Weinhold
548d054be0dSIngo Weinholdprivate:
549d054be0dSIngo Weinhold			typedef BObjectList<DwarfFunctionParameter> ParameterList;
550d054be0dSIngo Weinhold
551d054be0dSIngo Weinholdprivate:
552d054be0dSIngo Weinhold			DIESubroutineType*	fEntry;
553d054be0dSIngo Weinhold			DwarfType*			fReturnType;
554d054be0dSIngo Weinhold			ParameterList		fParameters;
555d054be0dSIngo Weinhold			bool				fHasVariableArguments;
556d054be0dSIngo Weinhold};
557d054be0dSIngo Weinhold
558d054be0dSIngo Weinhold
559d054be0dSIngo Weinholdclass DwarfPointerToMemberType : public PointerToMemberType, public DwarfType {
560d054be0dSIngo Weinholdpublic:
561d054be0dSIngo Weinhold								DwarfPointerToMemberType(
562d054be0dSIngo Weinhold									DwarfTypeContext* typeContext,
563d054be0dSIngo Weinhold									const BString& name,
564d054be0dSIngo Weinhold									DIEPointerToMemberType* entry,
565d054be0dSIngo Weinhold									DwarfCompoundType* containingType,
566d054be0dSIngo Weinhold									DwarfType* baseType);
567d054be0dSIngo Weinhold								~DwarfPointerToMemberType();
568d054be0dSIngo Weinhold
569d054be0dSIngo Weinhold	virtual	CompoundType*		ContainingType() const;
570d054be0dSIngo Weinhold	virtual	Type*				BaseType() const;
571d054be0dSIngo Weinhold
572d054be0dSIngo Weinhold	virtual	DIEType*			GetDIEType() const;
573d054be0dSIngo Weinhold
574d054be0dSIngo Weinhold			DIEPointerToMemberType* Entry() const
575d054be0dSIngo Weinhold									{ return fEntry; }
576d054be0dSIngo Weinhold
577d054be0dSIngo Weinholdprivate:
578d054be0dSIngo Weinhold			DIEPointerToMemberType* fEntry;
579d054be0dSIngo Weinhold			DwarfCompoundType*	fContainingType;
580d054be0dSIngo Weinhold			DwarfType*			fBaseType;
581d054be0dSIngo Weinhold};
582d054be0dSIngo Weinhold
583d054be0dSIngo Weinhold
584d054be0dSIngo Weinhold#endif	// DWARF_TYPES_H
585