[haiku-commits] haiku: hrev49253 - in src/apps/debugger: value/value_nodes value debug_managers jobs

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 8 Jun 2015 03:41:40 +0200 (CEST)

hrev49253 adds 2 changesets to branch 'master'
old head: 9457b76963e6c42507bc913a4e77dd78cbce7c38
new head: d2a6418f63f04178dd2ffe332d169ec8b7593087
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=d2a6418f63f0+%5E9457b76963e6

----------------------------------------------------------------------------

5ea6993dc22b: Debugger: Fix edit mode redraw issue.

MemoryView:
- During edit mode, if navigating with the left or right arrow
only resulted adjusting the focus nybble and not transitioning
to another block, redraw wouldn't be triggered, leading to it appearing
as if the keypress had no effect.

d2a6418f63f0: Debugger: Cleanups, no functional change.

- Remove out-of-place accessor to type lookup info on ValueLoader.
Instead, adjust CreateChildren() and CreateChildrenInRange() to take a
TeamTypeInformation parameter. This can then be used by value nodes that
need to be able to look up type information in order to properly
publish their children, such as BList and BMessage. Refactor subclasses
and callers accordingly

[ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

18 files changed, 80 insertions(+), 114 deletions(-)
.../debugger/debug_managers/ValueNodeManager.cpp | 11 ++++---
src/apps/debugger/jobs/ResolveValueNodeJob.cpp | 8 ++---
.../gui/inspector_window/MemoryView.cpp | 4 +++
.../gui/team_window/VariablesView.cpp | 1 +
src/apps/debugger/value/ValueLoader.cpp | 32 ++------------------
src/apps/debugger/value/ValueLoader.h | 13 +-------
src/apps/debugger/value/ValueNode.cpp | 6 ++--
src/apps/debugger/value/ValueNode.h | 11 ++++---
.../value/value_nodes/AddressValueNode.cpp | 3 +-
.../value/value_nodes/AddressValueNode.h | 3 +-
.../value/value_nodes/ArrayValueNode.cpp | 10 +++---
.../debugger/value/value_nodes/ArrayValueNode.h | 9 +++---
.../value/value_nodes/BListValueNode.cpp | 22 +++++---------
.../debugger/value/value_nodes/BListValueNode.h | 10 +++---
.../value/value_nodes/BMessageValueNode.cpp | 30 ++++++++----------
.../value/value_nodes/BMessageValueNode.h | 15 ++++-----
.../value/value_nodes/CompoundValueNode.cpp | 3 +-
.../value/value_nodes/CompoundValueNode.h | 3 +-

############################################################################

Commit: 5ea6993dc22bb63322768a91f19e58472a749778
URL: http://cgit.haiku-os.org/haiku/commit/?id=5ea6993dc22b
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Mon Jun 8 01:33:44 2015 UTC

Debugger: Fix edit mode redraw issue.

MemoryView:
- During edit mode, if navigating with the left or right arrow
only resulted adjusting the focus nybble and not transitioning
to another block, redraw wouldn't be triggered, leading to it appearing
as if the keypress had no effect.

----------------------------------------------------------------------------

diff --git
a/src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
b/src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
index 5cc2744..e1cacc8 100644
--- a/src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
+++ b/src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
@@ -358,6 +358,8 @@ MemoryView::KeyDown(const char* bytes, int32 numBytes)
if (!fEditLowNybble)
newAddress--;
fEditLowNybble = !fEditLowNybble;
+ if (newAddress == fTargetAddress)
+ Invalidate();
} else
newAddress -= blockSize;
break;
@@ -368,6 +370,8 @@ MemoryView::KeyDown(const char* bytes, int32 numBytes)
if (fEditLowNybble)
newAddress++;
fEditLowNybble = !fEditLowNybble;
+ if (newAddress == fTargetAddress)
+ Invalidate();
} else
newAddress += blockSize;
break;

############################################################################

Revision: hrev49253
Commit: d2a6418f63f04178dd2ffe332d169ec8b7593087
URL: http://cgit.haiku-os.org/haiku/commit/?id=d2a6418f63f0
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 7 17:27:13 2015 UTC

Debugger: Cleanups, no functional change.

- Remove out-of-place accessor to type lookup info on ValueLoader.
Instead, adjust CreateChildren() and CreateChildrenInRange() to take a
TeamTypeInformation parameter. This can then be used by value nodes that
need to be able to look up type information in order to properly
publish their children, such as BList and BMessage. Refactor subclasses
and callers accordingly

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.cpp
b/src/apps/debugger/debug_managers/ValueNodeManager.cpp
index 4dee711..20f6808 100644
--- a/src/apps/debugger/debug_managers/ValueNodeManager.cpp
+++ b/src/apps/debugger/debug_managers/ValueNodeManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2012, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2012-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -9,6 +9,7 @@
#include "AutoLocker.h"

#include "StackFrame.h"
+#include "Team.h"
#include "Thread.h"
#include "TypeHandlerRoster.h"
#include "ValueNode.h"
@@ -107,7 +108,7 @@ ValueNodeManager::ValueNodeChanged(ValueNodeChild*
nodeChild,
fListeners.ItemAt(i)->ValueNodeChanged(nodeChild, oldNode,
newNode);

if (oldNode != NULL)
- newNode->CreateChildren();
+
newNode->CreateChildren(fThread->GetTeam()->GetTeamTypeInformation());

}

@@ -149,7 +150,8 @@ ValueNodeManager::ValueNodeValueChanged(ValueNode*
valueNode)

if (valueNode->ChildCreationNeedsValue()
&& !valueNode->ChildrenCreated()) {
- status_t error = valueNode->CreateChildren();
+ status_t error = valueNode->CreateChildren(
+ fThread->GetTeam()->GetTeamTypeInformation());
if (error == B_OK) {
for (int32 i = 0; i < valueNode->CountChildren(); i++) {
ValueNodeChild* child = valueNode->ChildAt(i);
@@ -230,5 +232,6 @@ ValueNodeManager::AddChildNodes(ValueNodeChild* nodeChild)
if (valueNode->ChildrenCreated())
return B_OK;

- return valueNode->CreateChildren();
+ return valueNode->CreateChildren(
+ fThread->GetTeam()->GetTeamTypeInformation());
}
diff --git a/src/apps/debugger/jobs/ResolveValueNodeJob.cpp
b/src/apps/debugger/jobs/ResolveValueNodeJob.cpp
index 13712e3..ef30d85 100644
--- a/src/apps/debugger/jobs/ResolveValueNodeJob.cpp
+++ b/src/apps/debugger/jobs/ResolveValueNodeJob.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2012-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -154,8 +154,7 @@ ResolveValueNodeValueJob::_ResolveNodeValue()

// resolve the node location and value
ValueLoader valueLoader(fArchitecture, fDebuggerInterface,
- fTypeInformation, variableCpuState != NULL ? variableCpuState
- : fCpuState);
+ variableCpuState != NULL ? variableCpuState : fCpuState);
ValueLocation* location;
Value* value;
status_t error = fValueNode->ResolvedLocationAndValue(&valueLoader,
@@ -186,8 +185,7 @@ status_t
ResolveValueNodeValueJob::_ResolveNodeChildLocation(ValueNodeChild* nodeChild)
{
// resolve the location
- ValueLoader valueLoader(fArchitecture, fDebuggerInterface,
- fTypeInformation, fCpuState);
+ ValueLoader valueLoader(fArchitecture, fDebuggerInterface, fCpuState);
ValueLocation* location = NULL;
status_t error = nodeChild->ResolveLocation(&valueLoader, location);
BReference<ValueLocation> locationReference(location, true);
diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
index 4e1bfac..563f119 100644
--- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
@@ -2027,6 +2027,7 @@ VariablesView::MessageReceived(BMessage* message)
for (int32 i = 0; i < ranges.CountRanges(); i++) {
const Range* range = ranges.RangeAt(i);
result = valueNode->CreateChildrenInRange(
+
fThread->GetTeam()->GetTeamTypeInformation(),
range->lowerBound, range->upperBound);
if (result != B_OK)
break;
diff --git a/src/apps/debugger/value/ValueLoader.cpp
b/src/apps/debugger/value/ValueLoader.cpp
index 47bc151..78c7542 100644
--- a/src/apps/debugger/value/ValueLoader.cpp
+++ b/src/apps/debugger/value/ValueLoader.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/

@@ -12,38 +12,19 @@
#include "CpuState.h"
#include "Register.h"
#include "TeamMemory.h"
-#include "TeamTypeInformation.h"
#include "Tracing.h"
-#include "TypeLookupConstraints.h"
#include "ValueLocation.h"


ValueLoader::ValueLoader(Architecture* architecture, TeamMemory* teamMemory,
- TeamTypeInformation* typeInformation, CpuState* cpuState)
+ CpuState* cpuState)
:
fArchitecture(architecture),
fTeamMemory(teamMemory),
- fTypeInformation(typeInformation),
fCpuState(cpuState)
{
fArchitecture->AcquireReference();
fTeamMemory->AcquireReference();
- fTypeInformation->AcquireReference();
- if (fCpuState != NULL)
- fCpuState->AcquireReference();
-}
-
-
-ValueLoader::ValueLoader(const ValueLoader& other)
- :
- fArchitecture(other.fArchitecture),
- fTeamMemory(other.fTeamMemory),
- fTypeInformation(other.fTypeInformation),
- fCpuState(other.fCpuState)
-{
- fArchitecture->AcquireReference();
- fTeamMemory->AcquireReference();
- fTypeInformation->AcquireReference();
if (fCpuState != NULL)
fCpuState->AcquireReference();
}
@@ -53,7 +34,6 @@ ValueLoader::~ValueLoader()
{
fArchitecture->ReleaseReference();
fTeamMemory->ReleaseReference();
- fTypeInformation->ReleaseReference();
if (fCpuState != NULL)
fCpuState->ReleaseReference();
}
@@ -252,11 +232,3 @@ ValueLoader::LoadStringValue(BVariant& location, size_t
maxSize, BString& _value
return fTeamMemory->ReadMemoryString(location.ToUInt64(),
std::min(maxSize, kMaxStringSize), _value);
}
-
-
-status_t
-ValueLoader::LookupTypeByName(const BString& name,
- const TypeLookupConstraints& constraints, Type*& _type)
-{
- return fTypeInformation->LookupTypeByName(name, constraints, _type);
-}
diff --git a/src/apps/debugger/value/ValueLoader.h
b/src/apps/debugger/value/ValueLoader.h
index 13ac146..d17bef1 100644
--- a/src/apps/debugger/value/ValueLoader.h
+++ b/src/apps/debugger/value/ValueLoader.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -14,9 +15,6 @@
class Architecture;
class CpuState;
class TeamMemory;
-class TeamTypeInformation;
-class Type;
-class TypeLookupConstraints;
class ValueLocation;


@@ -24,10 +22,8 @@ class ValueLoader {
public:

ValueLoader(Architecture* architecture,

TeamMemory* teamMemory,
-
TeamTypeInformation* typeInformation,

CpuState* cpuState);
//
cpuState can be NULL
-
ValueLoader(const ValueLoader& other);
~ValueLoader();

Architecture* GetArchitecture() const
@@ -43,16 +39,9 @@ public:
status_t
LoadStringValue(BVariant& location,
size_t
maxSize, BString& _value);

- status_t LookupTypeByName(const
BString& name,
- const
TypeLookupConstraints& constraints,
- Type*&
_type);
- //
returns reference
-
private:
Architecture* fArchitecture;
TeamMemory* fTeamMemory;
- TeamTypeInformation*
-
fTypeInformation;
CpuState* fCpuState;
};

diff --git a/src/apps/debugger/value/ValueNode.cpp
b/src/apps/debugger/value/ValueNode.cpp
index 33bde4f..d868a07 100644
--- a/src/apps/debugger/value/ValueNode.cpp
+++ b/src/apps/debugger/value/ValueNode.cpp
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -85,7 +86,8 @@ ValueNode::ClearChildren()


status_t
-ValueNode::CreateChildrenInRange(int32 lowIndex, int32 highIndex)
+ValueNode::CreateChildrenInRange(TeamTypeInformation* info, int32 lowIndex,
+ int32 highIndex)
{
return B_NOT_SUPPORTED;
}
@@ -245,7 +247,7 @@ ChildlessValueNode::ChildlessValueNode(ValueNodeChild*
nodeChild)


status_t
-ChildlessValueNode::CreateChildren()
+ChildlessValueNode::CreateChildren(TeamTypeInformation* info)
{
return B_OK;
}
diff --git a/src/apps/debugger/value/ValueNode.h
b/src/apps/debugger/value/ValueNode.h
index c61f252..05f924a 100644
--- a/src/apps/debugger/value/ValueNode.h
+++ b/src/apps/debugger/value/ValueNode.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -11,6 +12,7 @@
#include <Referenceable.h>


+class TeamTypeInformation;
class Type;
class Value;
class ValueLoader;
@@ -52,7 +54,7 @@ public:
bool ChildrenCreated() const
{
return fChildrenCreated; }

- virtual status_t CreateChildren() = 0;
+ virtual status_t
CreateChildren(TeamTypeInformation* info) = 0;
virtual int32 CountChildren() const = 0;
virtual ValueNodeChild* ChildAt(int32 index) const = 0;

@@ -67,8 +69,9 @@ public:
//
arbitrarily go outside of the
//
specified/supported range.
virtual void ClearChildren();
- virtual status_t CreateChildrenInRange(int32
lowIndex,
- int32
highIndex);
+ virtual status_t CreateChildrenInRange(
+
TeamTypeInformation* info,
+ int32
lowIndex, int32 highIndex);
virtual status_t SupportedChildRange(int32&
lowIndex,
int32&
highIndex) const;

@@ -134,7 +137,7 @@ class ChildlessValueNode : public ValueNode {
public:

ChildlessValueNode(ValueNodeChild* nodeChild);

- virtual status_t CreateChildren();
+ virtual status_t
CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
};
diff --git a/src/apps/debugger/value/value_nodes/AddressValueNode.cpp
b/src/apps/debugger/value/value_nodes/AddressValueNode.cpp
index 37e80a3..3b85465 100644
--- a/src/apps/debugger/value/value_nodes/AddressValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/AddressValueNode.cpp
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -87,7 +88,7 @@ AddressValueNode::ResolvedLocationAndValue(ValueLoader*
valueLoader,


status_t
-AddressValueNode::CreateChildren()
+AddressValueNode::CreateChildren(TeamTypeInformation* info)
{
if (fChild != NULL)
return B_OK;
diff --git a/src/apps/debugger/value/value_nodes/AddressValueNode.h
b/src/apps/debugger/value/value_nodes/AddressValueNode.h
index d1dc16e..009fb92 100644
--- a/src/apps/debugger/value/value_nodes/AddressValueNode.h
+++ b/src/apps/debugger/value/value_nodes/AddressValueNode.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -28,7 +29,7 @@ public:

// locking required

- virtual status_t CreateChildren();
+ virtual status_t
CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;

diff --git a/src/apps/debugger/value/value_nodes/ArrayValueNode.cpp
b/src/apps/debugger/value/value_nodes/ArrayValueNode.cpp
index 301361e..f416145 100644
--- a/src/apps/debugger/value/value_nodes/ArrayValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/ArrayValueNode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -75,12 +75,12 @@
AbstractArrayValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,


status_t
-AbstractArrayValueNode::CreateChildren()
+AbstractArrayValueNode::CreateChildren(TeamTypeInformation* info)
{
if (!fChildren.IsEmpty())
return B_OK;

- return CreateChildrenInRange(0, kMaxArrayElementCount - 1);
+ return CreateChildrenInRange(info, 0, kMaxArrayElementCount - 1);
}


@@ -117,8 +117,8 @@ AbstractArrayValueNode::ClearChildren()


status_t
-AbstractArrayValueNode::CreateChildrenInRange(int32 lowIndex,
- int32 highIndex)
+AbstractArrayValueNode::CreateChildrenInRange(TeamTypeInformation* info,
+ int32 lowIndex, int32 highIndex)
{
// TODO: ensure that we don't already have children in the specified
// index range. These need to be skipped if so.
diff --git a/src/apps/debugger/value/value_nodes/ArrayValueNode.h
b/src/apps/debugger/value/value_nodes/ArrayValueNode.h
index 242954d..8bcbf6a 100644
--- a/src/apps/debugger/value/value_nodes/ArrayValueNode.h
+++ b/src/apps/debugger/value/value_nodes/ArrayValueNode.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -37,14 +37,15 @@ public:

// locking required

- virtual status_t CreateChildren();
+ 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(int32
lowIndex,
- int32
highIndex);
+ virtual status_t CreateChildrenInRange(
+
TeamTypeInformation* info,
+ int32
lowIndex, int32 highIndex);
virtual status_t SupportedChildRange(int32&
lowIndex,
int32&
highIndex) const;
protected:
diff --git a/src/apps/debugger/value/value_nodes/BListValueNode.cpp
b/src/apps/debugger/value/value_nodes/BListValueNode.cpp
index 147dccd..4a5a52d 100644
--- a/src/apps/debugger/value/value_nodes/BListValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/BListValueNode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013, Rene Gollent, rene@xxxxxxxxxxx
+ * Copyright 2012-2015, Rene Gollent, rene@xxxxxxxxxxx
* Distributed under the terms of the MIT License.
*/

@@ -13,6 +13,7 @@
#include "AddressValueNode.h"
#include "Architecture.h"
#include "StringValue.h"
+#include "TeamTypeInformation.h"
#include "Tracing.h"
#include "Type.h"
#include "TypeLookupConstraints.h"
@@ -163,7 +164,6 @@ BListValueNode::BListValueNode(ValueNodeChild* nodeChild,
:
ValueNode(nodeChild),
fType(type),
- fLoader(NULL),
fItemCountType(NULL),
fItemCount(0),
fCountChildCreated(false)
@@ -180,8 +180,6 @@ BListValueNode::~BListValueNode()

if (fItemCountType != NULL)
fItemCountType->ReleaseReference();
-
- delete fLoader;
}


@@ -292,20 +290,14 @@ BListValueNode::ResolvedLocationAndValue(ValueLoader*
valueLoader,
memberLocation = NULL;
}

- if (fLoader == NULL) {
- fLoader = new(std::nothrow)ValueLoader(*valueLoader);
- if (fLoader == NULL)
- return B_NO_MEMORY;
- }
-
return B_OK;
}


status_t
-BListValueNode::CreateChildren()
+BListValueNode::CreateChildren(TeamTypeInformation* info)
{
- return CreateChildrenInRange(0, kMaxArrayElementCount);
+ return CreateChildrenInRange(info, 0, kMaxArrayElementCount);
}


@@ -348,7 +340,8 @@ BListValueNode::ClearChildren()


status_t
-BListValueNode::CreateChildrenInRange(int32 lowIndex, int32 highIndex)
+BListValueNode::CreateChildrenInRange(TeamTypeInformation* info,
+ int32 lowIndex, int32 highIndex)
{
if (fLocationResolutionState != B_OK)
return fLocationResolutionState;
@@ -387,7 +380,8 @@ BListValueNode::CreateChildrenInRange(int32 lowIndex, int32
highIndex)
TypeLookupConstraints constraints;
constraints.SetTypeKind(TYPE_ADDRESS);
constraints.SetBaseTypeName("void");
- status_t result = fLoader->LookupTypeByName(typeName,
constraints, type);
+ status_t result = info->LookupTypeByName(typeName, constraints,
+ type);
if (result != B_OK)
return result;
}
diff --git a/src/apps/debugger/value/value_nodes/BListValueNode.h
b/src/apps/debugger/value/value_nodes/BListValueNode.h
index ce34e01..6a2e2b3 100644
--- a/src/apps/debugger/value/value_nodes/BListValueNode.h
+++ b/src/apps/debugger/value/value_nodes/BListValueNode.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2012-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
#ifndef BLIST_VALUE_NODE_H
@@ -32,15 +32,16 @@ public:

virtual bool
ChildCreationNeedsValue() const

{ return true; }
- virtual status_t CreateChildren();
+ 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(int32 lowIndex,
-
int32 highIndex);
+ virtual status_t CreateChildrenInRange(
+
TeamTypeInformation* info,
+
int32 lowIndex, int32 highIndex);
virtual status_t
SupportedChildRange(int32& lowIndex,

int32& highIndex) const;
private:
@@ -57,7 +58,6 @@ private:

Type* fType;
ChildNodeList fChildren;
- ValueLoader* fLoader;
BVariant fDataLocation;
BVariant
fItemCountLocation;
Type* fItemCountType;
diff --git a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp
b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp
index 0da34fe..3a3b1a7 100644
--- a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013, Rene Gollent, rene@xxxxxxxxxxx
+ * Copyright 2011-2015, Rene Gollent, rene@xxxxxxxxxxx
* Distributed under the terms of the MIT License.
*/

@@ -14,6 +14,7 @@

#include "Architecture.h"
#include "StringValue.h"
+#include "TeamTypeInformation.h"
#include "Tracing.h"
#include "Type.h"
#include "TypeLookupConstraints.h"
@@ -109,7 +110,6 @@ BMessageValueNode::BMessageValueNode(ValueNodeChild*
nodeChild,
:
ValueNode(nodeChild),
fType(type),
- fLoader(NULL),
fHeader(NULL),
fFields(NULL),
fData(NULL),
@@ -125,7 +125,6 @@ BMessageValueNode::~BMessageValueNode()
for (int32 i = 0; i < fChildren.CountItems(); i++)
fChildren.ItemAt(i)->ReleaseReference();

- delete fLoader;
delete fHeader;
delete[] fFields;
delete[] fData;
@@ -319,18 +318,12 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader*
valueLoader,
if (error != B_OK)
return error;

- if (fLoader == NULL) {
- fLoader = new(std::nothrow)ValueLoader(*valueLoader);
- if (fLoader == NULL)
- return B_NO_MEMORY;
- }
-
return B_OK;
}


status_t
-BMessageValueNode::CreateChildren()
+BMessageValueNode::CreateChildren(TeamTypeInformation* info)
{
DataMember* member = NULL;
CompoundType* messageType = dynamic_cast<CompoundType*>(fType);
@@ -358,7 +351,7 @@ BMessageValueNode::CreateChildren()
&count) == B_OK; i++) {
fieldType = NULL;

- _GetTypeForTypeCode(type, fieldType);
+ _GetTypeForTypeCode(info, type, fieldType);
if (fieldType != NULL)
typeRef.SetTo(fieldType, true);

@@ -397,8 +390,8 @@ BMessageValueNode::ChildAt(int32 index) const


status_t
-BMessageValueNode::_GetTypeForTypeCode(type_code type,
- Type*& _type)
+BMessageValueNode::_GetTypeForTypeCode(TeamTypeInformation* info,
+ type_code type, Type*& _type)
{
BString typeName;
TypeLookupConstraints constraints;
@@ -494,7 +487,7 @@ BMessageValueNode::_GetTypeForTypeCode(type_code type,
typeName = "char";
constraints.SetTypeKind(TYPE_PRIMITIVE);
Type* baseType = NULL;
- status_t result = fLoader->LookupTypeByName(typeName,
constraints,
+ status_t result = info->LookupTypeByName(typeName,
constraints,
baseType);
if (result != B_OK)
return result;
@@ -517,7 +510,7 @@ BMessageValueNode::_GetTypeForTypeCode(type_code type,
break;
}

- return fLoader->LookupTypeByName(typeName, constraints, _type);
+ return info->LookupTypeByName(typeName, constraints, _type);
}


@@ -647,17 +640,18 @@ BMessageValueNode::BMessageFieldNode::GetType() const


status_t
-BMessageValueNode::BMessageFieldNode::CreateChildren()
+BMessageValueNode::BMessageFieldNode::CreateChildren(TeamTypeInformation* info)
{
Type* type = NULL;
- status_t error = fParent->_GetTypeForTypeCode(fFieldType, type);
+ status_t error = fParent->_GetTypeForTypeCode(info, fFieldType, type);
if (error != B_OK)
return error;

BReference<Type> typeRef(type, true);
for (int32 i = 0; i < fFieldCount; i++) {
BMessageFieldNodeChild* child = new(std::nothrow)
- BMessageFieldNodeChild(fParent, type, fName,
fFieldType, fFieldCount, i);
+ BMessageFieldNodeChild(fParent, type, fName, fFieldType,
+ fFieldCount, i);

if (child == NULL)
return B_NO_MEMORY;
diff --git a/src/apps/debugger/value/value_nodes/BMessageValueNode.h
b/src/apps/debugger/value/value_nodes/BMessageValueNode.h
index 22768f5..dfe55e6 100644
--- a/src/apps/debugger/value/value_nodes/BMessageValueNode.h
+++ b/src/apps/debugger/value/value_nodes/BMessageValueNode.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2011-2015, Rene Gollent, rene@xxxxxxxxxxx.
* Distributed under the terms of the MIT License.
*/
#ifndef BMESSAGE_VALUE_NODE_H
@@ -19,8 +19,8 @@ class CompoundType;

class BMessageValueNode : public ValueNode {
public:
-
BMessageValueNode(ValueNodeChild* nodeChild,
-
Type* type);
+
BMessageValueNode(
+
ValueNodeChild* nodeChild, Type* type);
virtual
~BMessageValueNode();

virtual Type* GetType() const;
@@ -31,13 +31,15 @@ public:

virtual bool
ChildCreationNeedsValue() const

{ return true; }
- virtual status_t CreateChildren();
+ virtual status_t
CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;

private:

- status_t
_GetTypeForTypeCode(type_code type,
+ status_t
_GetTypeForTypeCode(
+
TeamTypeInformation* info,
+
type_code type,

Type*& _type);
status_t
_FindField(const char* name,

type_code type,
@@ -61,7 +63,6 @@ private:
private:
Type* fType;
ChildNodeList fChildren;
- ValueLoader* fLoader;
BVariant fDataLocation;
BMessage::message_header*
fHeader;
@@ -89,7 +90,7 @@ public:

ValueLocation *& _location,

Value*& _value);

- virtual status_t CreateChildren();
+ virtual status_t
CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;

diff --git a/src/apps/debugger/value/value_nodes/CompoundValueNode.cpp
b/src/apps/debugger/value/value_nodes/CompoundValueNode.cpp
index 6e208e7..c5dcc61 100644
--- a/src/apps/debugger/value/value_nodes/CompoundValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/CompoundValueNode.cpp
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -191,7 +192,7 @@ CompoundValueNode::ResolvedLocationAndValue(ValueLoader*
valueLoader,


status_t
-CompoundValueNode::CreateChildren()
+CompoundValueNode::CreateChildren(TeamTypeInformation* info)
{
if (!fChildren.IsEmpty())
return B_OK;
diff --git a/src/apps/debugger/value/value_nodes/CompoundValueNode.h
b/src/apps/debugger/value/value_nodes/CompoundValueNode.h
index 891a07a..51a705c 100644
--- a/src/apps/debugger/value/value_nodes/CompoundValueNode.h
+++ b/src/apps/debugger/value/value_nodes/CompoundValueNode.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -29,7 +30,7 @@ public:

// locking required

- virtual status_t CreateChildren();
+ virtual status_t
CreateChildren(TeamTypeInformation* info);
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;



Other related posts:

  • » [haiku-commits] haiku: hrev49253 - in src/apps/debugger: value/value_nodes value debug_managers jobs - anevilyak