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.
6 #ifndef IMAGE_DEBUG_INFO_H
7 #define IMAGE_DEBUG_INFO_H
12 #include <ObjectList.h>
13 #include <Referenceable.h>
15 #include "AddressSectionTypes.h"
16 #include "ImageInfo.h"
21 class DebuggerInterface
;
23 class FunctionDebugInfo
;
24 class FunctionInstance
;
25 class GlobalTypeCache
;
27 class SpecificImageDebugInfo
;
30 class TypeLookupConstraints
;
33 class ImageDebugInfo
: public BReferenceable
{
35 ImageDebugInfo(const ImageInfo
& imageInfo
);
38 const ImageInfo
& GetImageInfo() const { return fImageInfo
; }
40 bool AddSpecificInfo(SpecificImageDebugInfo
* info
);
41 status_t
FinishInit(DebuggerInterface
* interface
);
43 status_t
GetType(GlobalTypeCache
* cache
,
45 const TypeLookupConstraints
& constraints
,
47 // returns a reference
49 bool HasType(const BString
& name
,
50 const TypeLookupConstraints
& constraints
)
53 AddressSectionType
GetAddressSectionType(target_addr_t address
)
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;
68 typedef BObjectList
<SpecificImageDebugInfo
> SpecificInfoList
;
69 typedef BObjectList
<FunctionInstance
> FunctionList
;
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
,
82 SpecificInfoList fSpecificInfos
;
83 FunctionList fFunctions
;
84 FunctionInstance
* fMainFunction
;
88 #endif // IMAGE_DEBUG_INFO_H