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,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