btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / debug_info / ImageDebugInfo.h
blob501763068bd33e17277e8dbf506704d1fdca2af9
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2010-2013, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef IMAGE_DEBUG_INFO_H
7 #define IMAGE_DEBUG_INFO_H
10 #include <String.h>
12 #include <ObjectList.h>
13 #include <Referenceable.h>
15 #include "AddressSectionTypes.h"
16 #include "ImageInfo.h"
17 #include "Types.h"
20 class Architecture;
21 class DebuggerInterface;
22 class FileSourceCode;
23 class FunctionDebugInfo;
24 class FunctionInstance;
25 class GlobalTypeCache;
26 class LocatableFile;
27 class SpecificImageDebugInfo;
28 class SymbolInfo;
29 class Type;
30 class TypeLookupConstraints;
33 class ImageDebugInfo : public BReferenceable {
34 public:
35 ImageDebugInfo(const ImageInfo& imageInfo);
36 ~ImageDebugInfo();
38 const ImageInfo& GetImageInfo() const { return fImageInfo; }
40 bool AddSpecificInfo(SpecificImageDebugInfo* info);
41 status_t FinishInit(DebuggerInterface* interface);
43 status_t GetType(GlobalTypeCache* cache,
44 const BString& name,
45 const TypeLookupConstraints& constraints,
46 Type*& _type);
47 // returns a reference
49 bool HasType(const BString& name,
50 const TypeLookupConstraints& constraints)
51 const;
53 AddressSectionType GetAddressSectionType(target_addr_t address)
54 const;
56 int32 CountFunctions() const;
57 FunctionInstance* FunctionAt(int32 index) const;
58 FunctionInstance* FunctionAtAddress(target_addr_t address) const;
59 FunctionInstance* FunctionByName(const char* name) const;
61 FunctionInstance* MainFunction() const
62 { return fMainFunction; }
64 status_t AddSourceCodeInfo(LocatableFile* file,
65 FileSourceCode* sourceCode) const;
67 private:
68 typedef BObjectList<SpecificImageDebugInfo> SpecificInfoList;
69 typedef BObjectList<FunctionInstance> FunctionList;
71 private:
72 static int _CompareFunctions(const FunctionInstance* a,
73 const FunctionInstance* b);
74 static int _CompareAddressFunction(
75 const target_addr_t* address,
76 const FunctionInstance* function);
77 static int _CompareSymbols(const SymbolInfo* a,
78 const SymbolInfo* b);
80 private:
81 ImageInfo fImageInfo;
82 SpecificInfoList fSpecificInfos;
83 FunctionList fFunctions;
84 FunctionInstance* fMainFunction;
88 #endif // IMAGE_DEBUG_INFO_H