Debugger: Split into core library and application.
- Add subfolder src/kits/debugger which contains the debugger's core functionality and lower layers. Correspondingly add headers/private/debugger for shared headers to be used by clients such as the Debugger application and eventual remote_debug_server. Adjust various files to account for differences as a result of the split and moves. - Add libdebugger.so to minimal Jamfile.
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2010, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef FUNCTION_H
|
||||
#define FUNCTION_H
|
||||
|
||||
#include <util/DoublyLinkedList.h>
|
||||
#include <util/OpenHashTable.h>
|
||||
|
||||
#include "FunctionInstance.h"
|
||||
#include "LocatableFile.h"
|
||||
|
||||
|
||||
class FileSourceCode;
|
||||
|
||||
|
||||
class Function : public BReferenceable, private LocatableFile::Listener {
|
||||
public:
|
||||
class Listener;
|
||||
|
||||
public:
|
||||
Function();
|
||||
~Function();
|
||||
|
||||
// team must be locked to access the instances
|
||||
FunctionInstance* FirstInstance() const
|
||||
{ return fInstances.Head(); }
|
||||
FunctionInstance* LastInstance() const
|
||||
{ return fInstances.Tail(); }
|
||||
const FunctionInstanceList& Instances() const
|
||||
{ return fInstances; }
|
||||
|
||||
const BString& Name() const
|
||||
{ return FirstInstance()->Name(); }
|
||||
const BString& PrettyName() const
|
||||
{ return FirstInstance()->PrettyName(); }
|
||||
LocatableFile* SourceFile() const
|
||||
{ return FirstInstance()->SourceFile(); }
|
||||
SourceLocation GetSourceLocation() const
|
||||
{ return FirstInstance()
|
||||
->GetSourceLocation(); }
|
||||
|
||||
FunctionID* GetFunctionID() const
|
||||
{ return FirstInstance()->GetFunctionID(); }
|
||||
// returns a reference
|
||||
|
||||
// mutable attributes follow (locking required)
|
||||
FileSourceCode* GetSourceCode() const { return fSourceCode; }
|
||||
function_source_state SourceCodeState() const
|
||||
{ return fSourceCodeState; }
|
||||
void SetSourceCode(FileSourceCode* source,
|
||||
function_source_state state);
|
||||
|
||||
void AddListener(Listener* listener);
|
||||
void RemoveListener(Listener* listener);
|
||||
|
||||
// package private
|
||||
void AddInstance(FunctionInstance* instance);
|
||||
void RemoveInstance(FunctionInstance* instance);
|
||||
|
||||
void NotifySourceCodeChanged();
|
||||
|
||||
void LocatableFileChanged(LocatableFile* file);
|
||||
|
||||
private:
|
||||
typedef DoublyLinkedList<Listener> ListenerList;
|
||||
|
||||
private:
|
||||
FunctionInstanceList fInstances;
|
||||
FileSourceCode* fSourceCode;
|
||||
function_source_state fSourceCodeState;
|
||||
ListenerList fListeners;
|
||||
int32 fNotificationsDisabled;
|
||||
|
||||
public:
|
||||
// BOpenHashTable support
|
||||
Function* fNext;
|
||||
};
|
||||
|
||||
|
||||
class Function::Listener : public DoublyLinkedListLinkImpl<Listener> {
|
||||
public:
|
||||
virtual ~Listener();
|
||||
|
||||
virtual void FunctionSourceCodeChanged(Function* function);
|
||||
// called with lock held
|
||||
};
|
||||
|
||||
|
||||
#endif // FUNCTION_H
|
||||
Reference in New Issue
Block a user