2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2014-2016, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
6 #ifndef TEAM_DEBUG_INFO_H
7 #define TEAM_DEBUG_INFO_H
12 #include <ObjectList.h>
13 #include <Referenceable.h>
14 #include <util/OpenHashTable.h>
16 #include "GlobalTypeLookup.h"
17 #include "ImageInfo.h"
18 #include "TeamFunctionSourceInformation.h"
19 #include "TeamTypeInformation.h"
22 class DebuggerInterface
;
23 class DisassembledCode
;
28 class FunctionInstance
;
30 class ImageDebugInfoLoadingState
;
35 class SpecificTeamDebugInfo
;
38 class TeamDebugInfo
: public BReferenceable
, public GlobalTypeLookup
,
39 public TeamTypeInformation
, public TeamFunctionSourceInformation
{
42 DebuggerInterface
* debuggerInterface
,
43 Architecture
* architecture
,
44 FileManager
* fileManager
);
49 virtual status_t
GetType(GlobalTypeCache
* cache
,
51 const TypeLookupConstraints
& constraints
,
53 virtual bool HasType(GlobalTypeCache
* cache
,
55 const TypeLookupConstraints
& constraints
);
57 virtual status_t
LookupTypeByName(const BString
& name
,
58 const TypeLookupConstraints
& constraints
,
60 virtual bool TypeExistsByName(const BString
& name
,
61 const TypeLookupConstraints
& constraints
);
63 virtual status_t
GetActiveSourceCode(FunctionDebugInfo
* info
,
66 status_t
LoadImageDebugInfo(const ImageInfo
& imageInfo
,
67 LocatableFile
* imageFile
,
68 ImageDebugInfoLoadingState
& state
,
69 ImageDebugInfo
*& _imageDebugInfo
);
71 status_t
LoadSourceCode(LocatableFile
* file
,
72 FileSourceCode
*& _sourceCode
);
74 void ClearSourceCode(LocatableFile
* file
);
76 status_t
DisassembleFunction(
77 FunctionInstance
* functionInstance
,
78 DisassembledCode
*& _sourceCode
);
80 FunctionInstance
* MainFunction() const
81 { return fMainFunction
; }
84 status_t
AddImageDebugInfo(
85 ImageDebugInfo
* imageDebugInfo
);
86 void RemoveImageDebugInfo(
87 ImageDebugInfo
* imageDebugInfo
);
88 ImageDebugInfo
* ImageDebugInfoByName(const char* name
) const;
90 Function
* FunctionAtSourceLocation(LocatableFile
* file
,
91 const SourceLocation
& location
) const;
92 Function
* FunctionByID(FunctionID
* functionID
) const;
95 struct FunctionHashDefinition
;
96 struct SourceFileEntry
;
97 struct SourceFileHashDefinition
;
99 typedef BObjectList
<SpecificTeamDebugInfo
> SpecificInfoList
;
100 typedef BObjectList
<ImageDebugInfo
> ImageList
;
101 typedef BOpenHashTable
<FunctionHashDefinition
> FunctionTable
;
102 typedef BOpenHashTable
<SourceFileHashDefinition
> SourceFileTable
;
105 status_t
_AddFunction(Function
* function
);
106 void _RemoveFunction(Function
* function
);
110 DebuggerInterface
* fDebuggerInterface
;
111 Architecture
* fArchitecture
;
112 FileManager
* fFileManager
;
113 SpecificInfoList fSpecificInfos
;
115 FunctionTable
* fFunctions
;
116 SourceFileTable
* fSourceFiles
;
117 GlobalTypeCache
* fTypeCache
;
118 FunctionInstance
* fMainFunction
;
122 #endif // TEAM_DEBUG_INFO_H