2009-06-20 17:20:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef FUNCTION_DEBUG_INFO_H
|
|
|
|
#define FUNCTION_DEBUG_INFO_H
|
|
|
|
|
|
|
|
#include <Referenceable.h>
|
2009-06-26 15:11:56 +00:00
|
|
|
#include <util/DoublyLinkedList.h>
|
2009-06-20 17:20:49 +00:00
|
|
|
|
|
|
|
#include "ArchitectureTypes.h"
|
2009-06-26 15:11:56 +00:00
|
|
|
#include "SourceLocation.h"
|
|
|
|
|
|
|
|
|
|
|
|
enum function_source_state {
|
|
|
|
FUNCTION_SOURCE_NOT_LOADED,
|
|
|
|
FUNCTION_SOURCE_LOADING,
|
|
|
|
FUNCTION_SOURCE_LOADED,
|
|
|
|
FUNCTION_SOURCE_UNAVAILABLE
|
|
|
|
};
|
2009-06-20 17:20:49 +00:00
|
|
|
|
|
|
|
|
2009-06-26 15:11:56 +00:00
|
|
|
class SourceCode;
|
2009-06-27 21:09:21 +00:00
|
|
|
class SpecificImageDebugInfo;
|
2009-06-20 17:20:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
class FunctionDebugInfo : public Referenceable {
|
|
|
|
public:
|
2009-06-26 15:11:56 +00:00
|
|
|
class Listener;
|
|
|
|
|
|
|
|
public:
|
|
|
|
FunctionDebugInfo();
|
2009-06-20 17:20:49 +00:00
|
|
|
virtual ~FunctionDebugInfo();
|
|
|
|
|
2009-06-27 21:09:21 +00:00
|
|
|
virtual SpecificImageDebugInfo* GetSpecificImageDebugInfo() const = 0;
|
2009-06-20 17:20:49 +00:00
|
|
|
virtual target_addr_t Address() const = 0;
|
|
|
|
virtual target_size_t Size() const = 0;
|
|
|
|
virtual const char* Name() const = 0;
|
|
|
|
virtual const char* PrettyName() const = 0;
|
2009-06-26 15:11:56 +00:00
|
|
|
|
|
|
|
virtual const char* SourceFileName() const = 0;
|
|
|
|
virtual SourceLocation SourceStartLocation() const = 0;
|
|
|
|
virtual SourceLocation SourceEndLocation() const = 0;
|
|
|
|
|
|
|
|
// mutable attributes follow (locking required)
|
|
|
|
SourceCode* GetSourceCode() const { return fSourceCode; }
|
|
|
|
function_source_state SourceCodeState() const
|
|
|
|
{ return fSourceCodeState; }
|
|
|
|
void SetSourceCode(SourceCode* source,
|
|
|
|
function_source_state state);
|
|
|
|
|
|
|
|
void AddListener(Listener* listener);
|
|
|
|
void RemoveListener(Listener* listener);
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef DoublyLinkedList<Listener> ListenerList;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// mutable
|
|
|
|
SourceCode* fSourceCode;
|
|
|
|
function_source_state fSourceCodeState;
|
|
|
|
ListenerList fListeners;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FunctionDebugInfo::Listener : public DoublyLinkedListLinkImpl<Listener> {
|
|
|
|
public:
|
|
|
|
virtual ~Listener();
|
|
|
|
|
|
|
|
virtual void FunctionSourceCodeChanged(
|
|
|
|
FunctionDebugInfo* function);
|
|
|
|
// called with lock held
|
2009-06-20 17:20:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FUNCTION_DEBUG_INFO_H
|