Files
haiku-beta6/headers/private/debugger/debug_info/TeamDebugInfo.h
T

123 lines
3.5 KiB
C++
Raw Normal View History

2009-06-27 21:09:21 +00:00
/*
* Copyright 2009, Ingo Weinhold, [email protected].
2016-09-09 22:41:07 -04:00
* Copyright 2014-2016, Rene Gollent, [email protected].
2009-06-27 21:09:21 +00:00
* Distributed under the terms of the MIT License.
*/
#ifndef TEAM_DEBUG_INFO_H
#define TEAM_DEBUG_INFO_H
#include <Locker.h>
2009-06-27 21:09:21 +00:00
#include <ObjectList.h>
#include <Referenceable.h>
#include <util/OpenHashTable.h>
2009-06-27 21:09:21 +00:00
#include "GlobalTypeLookup.h"
2009-06-27 21:09:21 +00:00
#include "ImageInfo.h"
2016-09-09 22:41:07 -04:00
#include "TeamFunctionSourceInformation.h"
#include "TeamTypeInformation.h"
2009-06-27 21:09:21 +00:00
class Architecture;
class DebuggerInterface;
class DisassembledCode;
2009-07-03 00:56:39 +00:00
class FileManager;
class FileSourceCode;
class Function;
class FunctionID;
class FunctionInstance;
2009-06-27 21:09:21 +00:00
class ImageDebugInfo;
class ImageDebugInfoLoadingState;
2009-06-27 21:09:21 +00:00
class ImageInfo;
2009-07-01 22:09:33 +00:00
class LocatableFile;
class SourceCode;
class SourceLocation;
2009-06-27 21:09:21 +00:00
class SpecificTeamDebugInfo;
2016-09-09 22:41:07 -04:00
class TeamDebugInfo : public BReferenceable, public GlobalTypeLookup,
public TeamTypeInformation, public TeamFunctionSourceInformation {
2009-06-27 21:09:21 +00:00
public:
TeamDebugInfo(
DebuggerInterface* debuggerInterface,
2009-07-03 00:56:39 +00:00
Architecture* architecture,
FileManager* fileManager);
2009-06-27 21:09:21 +00:00
~TeamDebugInfo();
status_t Init();
virtual status_t GetType(GlobalTypeCache* cache,
2011-06-30 22:30:48 +00:00
const BString& name,
const TypeLookupConstraints& constraints,
Type*& _type);
virtual bool HasType(GlobalTypeCache* cache,
const BString& name,
const TypeLookupConstraints& constraints);
virtual status_t LookupTypeByName(const BString& name,
const TypeLookupConstraints& constraints,
Type*& _type);
virtual bool TypeExistsByName(const BString& name,
const TypeLookupConstraints& constraints);
2016-09-09 22:41:07 -04:00
virtual status_t GetActiveSourceCode(FunctionDebugInfo* info,
SourceCode*& _code);
2009-06-27 21:09:21 +00:00
status_t LoadImageDebugInfo(const ImageInfo& imageInfo,
2009-07-01 22:09:33 +00:00
LocatableFile* imageFile,
ImageDebugInfoLoadingState& state,
2009-06-27 21:09:21 +00:00
ImageDebugInfo*& _imageDebugInfo);
status_t LoadSourceCode(LocatableFile* file,
FileSourceCode*& _sourceCode);
// returns reference
void ClearSourceCode(LocatableFile* file);
status_t DisassembleFunction(
FunctionInstance* functionInstance,
DisassembledCode*& _sourceCode);
// returns reference
FunctionInstance* MainFunction() const
{ return fMainFunction; }
// team is locked
status_t AddImageDebugInfo(
ImageDebugInfo* imageDebugInfo);
void RemoveImageDebugInfo(
ImageDebugInfo* imageDebugInfo);
ImageDebugInfo* ImageDebugInfoByName(const char* name) const;
Function* FunctionAtSourceLocation(LocatableFile* file,
const SourceLocation& location) const;
Function* FunctionByID(FunctionID* functionID) const;
2009-06-27 21:09:21 +00:00
private:
struct FunctionHashDefinition;
struct SourceFileEntry;
struct SourceFileHashDefinition;
2009-06-27 21:09:21 +00:00
typedef BObjectList<SpecificTeamDebugInfo> SpecificInfoList;
typedef BObjectList<ImageDebugInfo> ImageList;
typedef BOpenHashTable<FunctionHashDefinition> FunctionTable;
typedef BOpenHashTable<SourceFileHashDefinition> SourceFileTable;
private:
status_t _AddFunction(Function* function);
void _RemoveFunction(Function* function);
2009-06-27 21:09:21 +00:00
private:
BLocker fLock;
2009-06-27 21:09:21 +00:00
DebuggerInterface* fDebuggerInterface;
Architecture* fArchitecture;
2009-07-03 00:56:39 +00:00
FileManager* fFileManager;
2009-06-27 21:09:21 +00:00
SpecificInfoList fSpecificInfos;
ImageList fImages;
FunctionTable* fFunctions;
SourceFileTable* fSourceFiles;
GlobalTypeCache* fTypeCache;
FunctionInstance* fMainFunction;
2009-06-27 21:09:21 +00:00
};
#endif // TEAM_DEBUG_INFO_H