2009-06-20 21:20:49 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef IMAGE_DEBUG_INFO_H
|
|
|
|
#define IMAGE_DEBUG_INFO_H
|
|
|
|
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#include <ObjectList.h>
|
|
|
|
#include <Referenceable.h>
|
|
|
|
|
|
|
|
#include "ArchitectureTypes.h"
|
|
|
|
#include "ImageInfo.h"
|
|
|
|
|
|
|
|
|
|
|
|
class Architecture;
|
|
|
|
class DebuggerInterface;
|
|
|
|
class DebugInfo;
|
|
|
|
class FunctionDebugInfo;
|
|
|
|
|
|
|
|
|
|
|
|
class ImageDebugInfo : public Referenceable {
|
|
|
|
public:
|
|
|
|
ImageDebugInfo(const ImageInfo& imageInfo,
|
|
|
|
DebuggerInterface* debuggerInterface,
|
|
|
|
Architecture* architecture);
|
|
|
|
~ImageDebugInfo();
|
|
|
|
|
|
|
|
status_t Init();
|
|
|
|
|
2009-06-26 17:12:06 +04:00
|
|
|
int32 CountFunctions() const;
|
|
|
|
FunctionDebugInfo* FunctionAt(int32 index) const;
|
|
|
|
FunctionDebugInfo* FunctionAtAddress(target_addr_t address) const;
|
2009-06-20 21:20:49 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef BObjectList<DebugInfo> DebugInfoList;
|
2009-06-26 17:12:06 +04:00
|
|
|
typedef BObjectList<FunctionDebugInfo> FunctionList;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _CompareFunctions(const FunctionDebugInfo* a,
|
|
|
|
const FunctionDebugInfo* b);
|
|
|
|
static int _CompareAddressFunction(
|
|
|
|
const target_addr_t* address,
|
|
|
|
const FunctionDebugInfo* function);
|
2009-06-20 21:20:49 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
ImageInfo fImageInfo;
|
|
|
|
DebuggerInterface* fDebuggerInterface;
|
|
|
|
Architecture* fArchitecture;
|
|
|
|
DebugInfoList fDebugInfos;
|
2009-06-26 17:12:06 +04:00
|
|
|
FunctionList fFunctions;
|
2009-06-20 21:20:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // IMAGE_DEBUG_INFO_H
|