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:
Rene Gollent
2016-06-04 13:18:39 -04:00
parent e6687e8f3d
commit fce4895d18
417 changed files with 492 additions and 390 deletions
@@ -0,0 +1,28 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef TYPE_HANDLER_H
#define TYPE_HANDLER_H
#include <Referenceable.h>
class Type;
class ValueNode;
class ValueNodeChild;
class TypeHandler : public BReferenceable {
public:
virtual ~TypeHandler();
virtual float SupportsType(Type* type) = 0;
virtual status_t CreateValueNode(ValueNodeChild* nodeChild,
Type* type, ValueNode*& _node) = 0;
// returns a reference
};
#endif // TYPE_HANDLER_H
@@ -0,0 +1,51 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef TYPE_HANDLER_ROSTER_H
#define TYPE_HANDLER_ROSTER_H
#include <Locker.h>
#include <ObjectList.h>
class Type;
class TypeHandler;
class ValueNode;
class ValueNodeChild;
typedef BObjectList<TypeHandler> TypeHandlerList;
class TypeHandlerRoster {
public:
TypeHandlerRoster();
~TypeHandlerRoster();
static TypeHandlerRoster* Default();
static status_t CreateDefault();
static void DeleteDefault();
status_t Init();
status_t RegisterDefaultHandlers();
status_t FindTypeHandler(ValueNodeChild* nodeChild,
Type* type, TypeHandler*& _handler);
// returns a reference
status_t CreateValueNode(ValueNodeChild* nodeChild,
Type* type, ValueNode*& _node);
// returns a reference
bool RegisterHandler(TypeHandler* handler);
void UnregisterHandler(TypeHandler* handler);
private:
BLocker fLock;
TypeHandlerList fTypeHandlers;
static TypeHandlerRoster* sDefaultInstance;
};
#endif // TYPE_HANDLER_ROSTER_H
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef VALUE_H
#define VALUE_H
#include <String.h>
#include <Variant.h>
class Value : public BReferenceable {
public:
virtual ~Value();
virtual bool ToString(BString& _string) const = 0;
virtual bool ToVariant(BVariant& _value) const = 0;
virtual bool operator==(const Value& other) const = 0;
inline bool operator!=(const Value& other) const
{ return !(*this == other); }
};
#endif // VALUE_H
@@ -0,0 +1,42 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef VALUE_FORMATTER_H
#define VALUE_FORMATTER_H
#include <Referenceable.h>
class BString;
class Settings;
class Value;
class ValueFormatter : public BReferenceable {
public:
virtual ~ValueFormatter();
virtual Settings* GetSettings() const = 0;
// returns NULL, if no settings
virtual status_t FormatValue(Value* value, BString& _output)
= 0;
virtual bool SupportsValidation() const;
virtual bool ValidateFormattedValue(
const BString& input,
type_code type) const;
// checks if the passed in string
// would be considered a valid value
// according to the current format
// configuration and the size constraints
// imposed by the passed in type.
virtual status_t GetValueFromFormattedInput(
const BString& input, type_code type,
Value*& _output) const;
// returns reference
};
#endif // VALUE_FORMATTER_H
+146
View File
@@ -0,0 +1,146 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef VALUE_NODE_H
#define VALUE_NODE_H
#include <String.h>
#include <Referenceable.h>
class TeamTypeInformation;
class Type;
class Value;
class ValueLoader;
class ValueLocation;
class ValueNodeChild;
class ValueNodeContainer;
enum {
VALUE_NODE_UNRESOLVED = 1
};
class ValueNode : public BReferenceable {
public:
ValueNode(ValueNodeChild* nodeChild);
virtual ~ValueNode();
ValueNodeChild* NodeChild() const { return fNodeChild; }
virtual const BString& Name() const;
virtual Type* GetType() const = 0;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value) = 0;
// returns references, a NULL value can be
// returned
// locking required
ValueNodeContainer* Container() const
{ return fContainer; }
void SetContainer(ValueNodeContainer* container);
virtual bool ChildCreationNeedsValue() const
{ return false; }
bool ChildrenCreated() const
{ return fChildrenCreated; }
virtual status_t CreateChildren(TeamTypeInformation* info) = 0;
virtual int32 CountChildren() const = 0;
virtual ValueNodeChild* ChildAt(int32 index) const = 0;
// optional virtual hooks for container type value nodes such as
// arrays that may contain a variable (and potentially quite large)
// number of children. The calls below should be implemented for such
// node types to allow the upper layers to be aware of this, and to be
// able to request that only a subset of children be created.
virtual bool IsRangedContainer() const;
virtual bool IsContainerRangeFixed() const;
// indicates that the user can't
// arbitrarily go outside of the
// specified/supported range.
virtual void ClearChildren();
virtual status_t CreateChildrenInRange(
TeamTypeInformation* info,
int32 lowIndex, int32 highIndex);
virtual status_t SupportedChildRange(int32& lowIndex,
int32& highIndex) const;
status_t LocationAndValueResolutionState() const
{ return fLocationResolutionState; }
void SetLocationAndValue(ValueLocation* location,
Value* value, status_t resolutionState);
ValueLocation* Location() const { return fLocation; }
Value* GetValue() const { return fValue; }
// immutable after SetLocationAndValue()
protected:
ValueNodeContainer* fContainer;
ValueNodeChild* fNodeChild;
ValueLocation* fLocation;
Value* fValue;
status_t fLocationResolutionState;
bool fChildrenCreated;
};
class ValueNodeChild : public BReferenceable {
public:
ValueNodeChild();
virtual ~ValueNodeChild();
virtual const BString& Name() const = 0;
virtual Type* GetType() const = 0;
virtual ValueNode* Parent() const = 0;
virtual bool IsInternal() const;
virtual status_t CreateInternalNode(ValueNode*& _node);
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location) = 0;
// returns a reference
// locking required
ValueNodeContainer* Container() const
{ return fContainer; }
void SetContainer(ValueNodeContainer* container);
ValueNode* Node() const { return fNode; }
void SetNode(ValueNode* node);
status_t LocationResolutionState() const
{ return fLocationResolutionState; }
ValueLocation* Location() const;
// immutable after SetLocation()
void SetLocation(ValueLocation* location,
status_t resolutionState);
protected:
ValueNodeContainer* fContainer;
ValueNode* fNode;
ValueLocation* fLocation;
status_t fLocationResolutionState;
};
class ChildlessValueNode : public ValueNode {
public:
ChildlessValueNode(ValueNodeChild* nodeChild);
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
};
#endif // VALUE_NODE_H
@@ -0,0 +1,75 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef VALUE_NODE_CONTAINER_H
#define VALUE_NODE_CONTAINER_H
#include <Locker.h>
#include <ObjectList.h>
#include <Referenceable.h>
class ValueNode;
class ValueNodeChild;
class ValueNodeContainer : public BReferenceable {
public:
class Listener;
public:
ValueNodeContainer();
virtual ~ValueNodeContainer();
status_t Init();
inline bool Lock() { return fLock.Lock(); }
inline void Unlock() { fLock.Unlock(); }
int32 CountChildren() const;
ValueNodeChild* ChildAt(int32 index) const;
bool AddChild(ValueNodeChild* child);
void RemoveChild(ValueNodeChild* child);
void RemoveAllChildren();
bool AddListener(Listener* listener);
void RemoveListener(Listener* listener);
// container must be locked
void NotifyValueNodeChanged(
ValueNodeChild* nodeChild,
ValueNode* oldNode, ValueNode* newNode);
void NotifyValueNodeChildrenCreated(ValueNode* node);
void NotifyValueNodeChildrenDeleted(ValueNode* node);
void NotifyValueNodeValueChanged(ValueNode* node);
private:
typedef BObjectList<ValueNodeChild> NodeChildList;
typedef BObjectList<Listener> ListenerList;
private:
BLocker fLock;
NodeChildList fChildren;
ListenerList fListeners;
};
class ValueNodeContainer::Listener {
public:
virtual ~Listener();
// container is locked
virtual void ValueNodeChanged(ValueNodeChild* nodeChild,
ValueNode* oldNode, ValueNode* newNode);
virtual void ValueNodeChildrenCreated(ValueNode* node);
virtual void ValueNodeChildrenDeleted(ValueNode* node);
virtual void ValueNodeValueChanged(ValueNode* node);
};
#endif // VALUE_NODE_CONTAINER_H
@@ -0,0 +1,28 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef BOOL_VALUE_FORMATTER_H
#define BOOL_VALUE_FORMATTER_H
#include "ValueFormatter.h"
class Settings;
class Value;
class BoolValueFormatter : public ValueFormatter {
public:
BoolValueFormatter();
virtual ~BoolValueFormatter();
virtual Settings* GetSettings() const
{ return NULL; }
virtual status_t FormatValue(Value* value, BString& _output);
};
#endif // BOOL_VALUE_FORMATTER_H
@@ -0,0 +1,21 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ENUMERATION_VALUE_FORMATTER_H
#define ENUMERATION_VALUE_FORMATTER_H
#include "IntegerValueFormatter.h"
class EnumerationValueFormatter : public IntegerValueFormatter {
public:
EnumerationValueFormatter(Config* config);
virtual ~EnumerationValueFormatter();
virtual status_t FormatValue(Value* value, BString& _output);
};
#endif // ENUMERATION_VALUE_FORMATTER_H
@@ -0,0 +1,44 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef FLOAT_VALUE_FORMATTER_H
#define FLOAT_VALUE_FORMATTER_H
#include "ValueFormatter.h"
class Settings;
class Value;
class FloatValueFormatter : public ValueFormatter {
public:
FloatValueFormatter();
virtual ~FloatValueFormatter();
virtual Settings* GetSettings() const
{ return NULL; }
virtual status_t FormatValue(Value* value, BString& _output);
virtual bool SupportsValidation() const;
virtual bool ValidateFormattedValue(
const BString& input,
type_code type) const;
virtual status_t GetValueFromFormattedInput(
const BString& input, type_code type,
Value*& _output) const;
private:
status_t _PerformValidation(const BString& input,
type_code type,
::Value*& _output,
bool wantsValue) const;
};
#endif // FLOAT_VALUE_FORMATTER_H
@@ -0,0 +1,70 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef INTEGER_VALUE_FORMATTER_H
#define INTEGER_VALUE_FORMATTER_H
#include "util/IntegerFormatter.h"
#include "ValueFormatter.h"
class Settings;
class Value;
class IntegerValueFormatter : public ValueFormatter {
public:
class Config;
public:
IntegerValueFormatter(Config* config);
virtual ~IntegerValueFormatter();
Config* GetConfig() const
{ return fConfig; }
virtual Settings* GetSettings() const;
virtual status_t FormatValue(Value* value, BString& _output);
virtual bool SupportsValidation() const;
virtual bool ValidateFormattedValue(
const BString& input,
type_code type) const;
virtual status_t GetValueFromFormattedInput(
const BString& input, type_code type,
Value*& _output) const;
private:
status_t _PerformValidation(const BString& input,
type_code type,
::Value*& _output,
bool wantsValue) const;
status_t _ValidateSigned(const BString& input,
type_code type,
::Value*& _output,
bool wantsValue = false) const;
status_t _ValidateUnsigned(const BString& input,
type_code type,
::Value*& _output,
integer_format format,
bool wantsValue = false) const;
Config* fConfig;
};
class IntegerValueFormatter::Config : public BReferenceable {
public:
virtual ~Config();
virtual Settings* GetSettings() const = 0;
virtual integer_format IntegerFormat() const = 0;
};
#endif // INTEGER_VALUE_FORMATTER_H
@@ -0,0 +1,28 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef STRING_VALUE_FORMATTER_H
#define STRING_VALUE_FORMATTER_H
#include "ValueFormatter.h"
class Settings;
class Value;
class StringValueFormatter : public ValueFormatter {
public:
StringValueFormatter();
virtual ~StringValueFormatter();
virtual Settings* GetSettings() const
{ return NULL; }
virtual status_t FormatValue(Value* value, BString& _output);
};
#endif // STRING_VALUE_FORMATTER_H
@@ -0,0 +1,62 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ADDRESS_VALUE_NODE_H
#define ADDRESS_VALUE_NODE_H
#include "ValueNode.h"
class AddressValueNodeChild;
class AddressType;
class AddressValueNode : public ValueNode {
public:
AddressValueNode(ValueNodeChild* nodeChild,
AddressType* type);
virtual ~AddressValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
// locking required
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
private:
AddressType* fType;
AddressValueNodeChild* fChild;
};
class AddressValueNodeChild : public ValueNodeChild {
public:
AddressValueNodeChild(AddressValueNode* parent,
const BString& name, Type* type);
virtual ~AddressValueNodeChild();
virtual const BString& Name() const;
virtual Type* GetType() const;
virtual ValueNode* Parent() const;
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
AddressValueNode* fParent;
BString fName;
Type* fType;
};
#endif // ADDRESS_VALUE_NODE_H
@@ -0,0 +1,142 @@
/*
* Copyright 2013-2015, Rene Gollent, [email protected].
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ARRAY_VALUE_NODE_H
#define ARRAY_VALUE_NODE_H
#include <ObjectList.h>
#include "ValueNode.h"
class AbstractArrayValueNodeChild;
class ArrayType;
class AbstractArrayValueNode : public ValueNode {
public:
AbstractArrayValueNode(
ValueNodeChild* nodeChild, ArrayType* type,
int32 dimension);
virtual ~AbstractArrayValueNode();
ArrayType* GetArrayType() const
{ return fType; }
int32 Dimension() const
{ return fDimension; }
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
// locking required
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
virtual bool IsRangedContainer() const;
virtual void ClearChildren();
virtual status_t CreateChildrenInRange(
TeamTypeInformation* info,
int32 lowIndex, int32 highIndex);
virtual status_t SupportedChildRange(int32& lowIndex,
int32& highIndex) const;
protected:
typedef BObjectList<AbstractArrayValueNodeChild> ChildList;
protected:
ArrayType* fType;
ChildList fChildren;
int32 fDimension;
int32 fLowerBound;
int32 fUpperBound;
bool fBoundsInitialized;
};
// TODO: Are ArrayValueNode and InternalArrayValueNode still needed?
class ArrayValueNode : public AbstractArrayValueNode {
public:
ArrayValueNode(ValueNodeChild* nodeChild,
ArrayType* type);
virtual ~ArrayValueNode();
};
class InternalArrayValueNode : public AbstractArrayValueNode {
public:
InternalArrayValueNode(
ValueNodeChild* nodeChild,
ArrayType* type, int32 dimension);
virtual ~InternalArrayValueNode();
};
class AbstractArrayValueNodeChild : public ValueNodeChild {
public:
AbstractArrayValueNodeChild(
AbstractArrayValueNode* parent,
const BString& name, int64 elementIndex);
virtual ~AbstractArrayValueNodeChild();
AbstractArrayValueNode* ArrayParent() const { return fParent; }
int32 ElementIndex() const { return fElementIndex; }
virtual const BString& Name() const;
virtual ValueNode* Parent() const;
protected:
AbstractArrayValueNode* fParent;
BString fName;
int64 fElementIndex;
};
class ArrayValueNodeChild : public AbstractArrayValueNodeChild {
public:
ArrayValueNodeChild(
AbstractArrayValueNode* parent,
const BString& name, int64 elementIndex,
Type* type);
virtual ~ArrayValueNodeChild();
virtual Type* GetType() const;
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
Type* fType;
};
class InternalArrayValueNodeChild : public AbstractArrayValueNodeChild {
public:
InternalArrayValueNodeChild(
AbstractArrayValueNode* parent,
const BString& name, int64 elementIndex,
ArrayType* type);
virtual ~InternalArrayValueNodeChild();
virtual Type* GetType() const;
virtual bool IsInternal() const;
virtual status_t CreateInternalNode(ValueNode*& _node);
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
ArrayType* fType;
};
#endif // ARRAY_VALUE_NODE_H
@@ -0,0 +1,69 @@
/*
* Copyright 2012-2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef BLIST_VALUE_NODE_H
#define BLIST_VALUE_NODE_H
#include <List.h>
#include <Variant.h>
#include <ObjectList.h>
#include "ValueLocation.h"
#include "ValueNode.h"
class CompoundType;
class BListValueNode : public ValueNode {
public:
BListValueNode(ValueNodeChild* nodeChild,
Type* type);
virtual ~BListValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
virtual bool ChildCreationNeedsValue() const
{ return true; }
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
virtual bool IsRangedContainer() const;
virtual bool IsContainerRangeFixed() const;
virtual void ClearChildren();
virtual status_t CreateChildrenInRange(
TeamTypeInformation* info,
int32 lowIndex, int32 highIndex);
virtual status_t SupportedChildRange(int32& lowIndex,
int32& highIndex) const;
private:
class BListElementNodeChild;
class BListItemCountNodeChild;
// for GCC2
friend class BListElementNodeChild;
friend class BListItemCountNodeChild;
typedef BObjectList<ValueNodeChild> ChildNodeList;
private:
Type* fType;
ChildNodeList fChildren;
BVariant fDataLocation;
BVariant fItemCountLocation;
Type* fItemCountType;
int32 fItemCount;
bool fCountChildCreated;
};
#endif // BLIST_VALUE_NODE_H
@@ -0,0 +1,139 @@
/*
* Copyright 2011-2015, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef BMESSAGE_VALUE_NODE_H
#define BMESSAGE_VALUE_NODE_H
#include <Message.h>
#include <MessagePrivate.h>
#include <ObjectList.h>
#include <Variant.h>
#include "ValueLocation.h"
#include "ValueNode.h"
class CompoundType;
class BMessageValueNode : public ValueNode {
public:
BMessageValueNode(
ValueNodeChild* nodeChild, Type* type);
virtual ~BMessageValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
virtual bool ChildCreationNeedsValue() const
{ return true; }
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
private:
status_t _GetTypeForTypeCode(
TeamTypeInformation* info,
type_code type,
Type*& _type);
status_t _FindField(const char* name,
type_code type,
BMessage::field_header** result) const;
uint32 _HashName(const char* name) const;
status_t _FindDataLocation(const char* name,
type_code type, int32 index,
ValueLocation& location) const;
private:
class BMessageFieldNode;
class BMessageFieldNodeChild;
// for GCC2
friend class BMessageFieldNode;
friend class BMessageFieldNodeChild;
friend class BMessageWhatNodeChild;
typedef BObjectList<ValueNodeChild> ChildNodeList;
private:
Type* fType;
ChildNodeList fChildren;
BVariant fDataLocation;
BMessage::message_header*
fHeader;
BMessage::field_header* fFields;
uint8* fData;
BMessage fMessage;
bool fIsFlatMessage;
};
class BMessageValueNode::BMessageFieldNode : public ValueNode {
public:
BMessageFieldNode(
BMessageFieldNodeChild *child,
BMessageValueNode* parent,
const BString& name,
type_code type, int32 count);
virtual ~BMessageFieldNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* loader,
ValueLocation *& _location,
Value*& _value);
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
private:
BString fName;
Type* fType;
BMessageValueNode* fParent;
type_code fFieldType;
int32 fFieldCount;
ChildNodeList fChildren;
};
class BMessageValueNode::BMessageFieldNodeChild : public ValueNodeChild {
public:
BMessageFieldNodeChild(
BMessageValueNode* parent,
Type* nodeType,
const BString &name,
type_code type, int32 count,
int32 index = -1);
virtual ~BMessageFieldNodeChild();
virtual const BString& Name() const;
virtual Type* GetType() const;
virtual ValueNode* Parent() const;
virtual bool IsInternal() const;
virtual status_t CreateInternalNode(
ValueNode*& _node);
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
BString fName;
BString fPresentationName;
Type* fType;
BMessageValueNode* fParent;
type_code fFieldType;
int32 fFieldCount;
int32 fFieldIndex;
};
#endif // BMESSAGE_VALUE_NODE_H
@@ -0,0 +1,32 @@
/*
* Copyright 2010, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef CSTRING_VALUE_NODE_H
#define CSTRING_VALUE_NODE_H
#include "ValueNode.h"
class AddressType;
class CStringValueNode : public ChildlessValueNode {
public:
CStringValueNode(ValueNodeChild* nodeChild,
Type* type);
virtual ~CStringValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
private:
Type* fType;
};
#endif // CSTRING_VALUE_NODE_H
@@ -0,0 +1,54 @@
/*
* Copyright 2015, Rene Gollent, [email protected].
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef COMPOUND_VALUE_NODE_H
#define COMPOUND_VALUE_NODE_H
#include <ObjectList.h>
#include "ValueNode.h"
class CompoundType;
class CompoundValueNode : public ValueNode {
public:
CompoundValueNode(ValueNodeChild* nodeChild,
CompoundType* type);
virtual ~CompoundValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
// locking required
virtual status_t CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
private:
class Child;
class BaseTypeChild;
class MemberChild;
// for GCC2
friend class BaseTypeChild;
friend class MemberChild;
typedef BObjectList<Child> ChildList;
private:
CompoundType* fType;
ChildList fChildren;
};
#endif // ADDRESS_VALUE_NODE_H
@@ -0,0 +1,33 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ENUMERATION_VALUE_NODE_H
#define ENUMERATION_VALUE_NODE_H
#include "ValueNode.h"
class EnumerationType;
class EnumerationValueNode : public ChildlessValueNode {
public:
EnumerationValueNode(ValueNodeChild* nodeChild,
EnumerationType* type);
virtual ~EnumerationValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
private:
EnumerationType* fType;
};
#endif // ENUMERATION_VALUE_NODE_H
@@ -0,0 +1,56 @@
/*
* Copyright 2014, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef EXPRESSION_VALUE_NODE_H
#define EXPRESSION_VALUE_NODE_H
#include "ValueNode.h"
class ExpressionValueNodeChild;
class ExpressionValueNode : public ChildlessValueNode {
public:
ExpressionValueNode(
ExpressionValueNodeChild* nodeChild,
Type* type);
virtual ~ExpressionValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
private:
Type* fType;
};
class ExpressionValueNodeChild : public ValueNodeChild {
public:
ExpressionValueNodeChild(
const BString& expression,
Type* type);
virtual ~ExpressionValueNodeChild();
virtual const BString& Name() const;
virtual Type* GetType() const;
virtual ValueNode* Parent() const;
const BString& GetExpression() const { return fExpression; };
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
BString fExpression;
Type* fResultType;
};
#endif // EXPRESSION_VALUE_NODE_H
@@ -0,0 +1,34 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef POINTER_TO_MEMBER_VALUE_NODE_H
#define POINTER_TO_MEMBER_VALUE_NODE_H
#include "ValueNode.h"
class PointerToMemberType;
class PointerToMemberValueNode : public ChildlessValueNode {
public:
PointerToMemberValueNode(
ValueNodeChild* nodeChild,
PointerToMemberType* type);
virtual ~PointerToMemberValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
private:
PointerToMemberType* fType;
};
#endif // POINTER_TO_MEMBER_VALUE_NODE_H
@@ -0,0 +1,33 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef PRIMITIVE_VALUE_NODE_H
#define PRIMITIVE_VALUE_NODE_H
#include "ValueNode.h"
class PrimitiveType;
class PrimitiveValueNode : public ChildlessValueNode {
public:
PrimitiveValueNode(ValueNodeChild* nodeChild,
PrimitiveType* type);
virtual ~PrimitiveValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
private:
PrimitiveType* fType;
};
#endif // PRIMITIVE_VALUE_NODE_H
@@ -0,0 +1,34 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef VARIABLE_VALUE_NODE_CHILD_H
#define VARIABLE_VALUE_NODE_CHILD_H
#include "ValueNode.h"
class Variable;
class VariableValueNodeChild : public ValueNodeChild {
public:
VariableValueNodeChild(Variable* variable);
virtual ~VariableValueNodeChild();
virtual const BString& Name() const;
virtual Type* GetType() const;
virtual ValueNode* Parent() const;
Variable* GetVariable() const { return fVariable; };
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
Variable* fVariable;
};
#endif // VARIABLE_VALUE_NODE_CHILD_H
@@ -0,0 +1,21 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ADDRESS_VALUE_H
#define ADDRESS_VALUE_H
#include "IntegerValue.h"
class AddressValue : public IntegerValue {
public:
AddressValue(const BVariant& value);
virtual ~AddressValue();
virtual bool ToString(BString& _string) const;
};
#endif // ADDRESS_VALUE_H
@@ -0,0 +1,30 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef BOOL_VALUE_H
#define BOOL_VALUE_H
#include "Value.h"
class BoolValue : public Value {
public:
BoolValue(bool value);
virtual ~BoolValue();
bool GetValue() const
{ return fValue; }
virtual bool ToString(BString& _string) const;
virtual bool ToVariant(BVariant& _value) const;
virtual bool operator==(const Value& other) const;
private:
bool fValue;
};
#endif // BOOL_VALUE_H
@@ -0,0 +1,31 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef ENUMERATION_VALUE_H
#define ENUMERATION_VALUE_H
#include "IntegerValue.h"
class EnumerationType;
class EnumerationValue : public IntegerValue {
public:
EnumerationValue(EnumerationType* type,
const BVariant& value);
virtual ~EnumerationValue();
EnumerationType* GetType() const
{ return fType; }
virtual bool ToString(BString& _string) const;
private:
EnumerationType* fType;
};
#endif // ENUMERATION_VALUE_H
@@ -0,0 +1,30 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef FLOAT_VALUE_H
#define FLOAT_VALUE_H
#include "Value.h"
class FloatValue : public Value {
public:
FloatValue(const BVariant& value);
virtual ~FloatValue();
BVariant GetValue() const
{ return fValue; }
virtual bool ToString(BString& _string) const;
virtual bool ToVariant(BVariant& _value) const;
virtual bool operator==(const Value& other) const;
private:
BVariant fValue;
};
#endif // FLOAT_VALUE_H
@@ -0,0 +1,36 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef INTEGER_VALUE_H
#define INTEGER_VALUE_H
#include "Value.h"
class IntegerValue : public Value {
public:
IntegerValue(const BVariant& value);
virtual ~IntegerValue();
bool IsSigned() const;
int64 ToInt64() const
{ return fValue.ToInt64(); }
uint64 ToUInt64() const
{ return fValue.ToUInt64(); }
const BVariant& GetValue() const
{ return fValue; }
virtual bool ToString(BString& _string) const;
virtual bool ToVariant(BVariant& _value) const;
virtual bool operator==(const Value& other) const;
protected:
BVariant fValue;
};
#endif // INTEGER_VALUE_H
@@ -0,0 +1,30 @@
/*
* Copyright 2010, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef STRING_VALUE_H
#define STRING_VALUE_H
#include "Value.h"
class StringValue : public Value {
public:
StringValue(const char* value);
virtual ~StringValue();
BString GetValue() const
{ return fValue; }
virtual bool ToString(BString& _string) const;
virtual bool ToVariant(BVariant& _value) const;
virtual bool operator==(const Value& other) const;
private:
BString fValue;
};
#endif // STRING_VALUE_H