From d2a6418f63f04178dd2ffe332d169ec8b7593087 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 7 Jun 2015 13:27:13 -0400 Subject: [PATCH] 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 --- .../debug_managers/ValueNodeManager.cpp | 11 ++++--- .../debugger/jobs/ResolveValueNodeJob.cpp | 8 ++--- .../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 +++--- .../value/value_nodes/ArrayValueNode.h | 9 +++--- .../value/value_nodes/BListValueNode.cpp | 22 +++++-------- .../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 +- 17 files changed, 76 insertions(+), 114 deletions(-) diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.cpp b/src/apps/debugger/debug_managers/ValueNodeManager.cpp index 4dee7114de..20f6808458 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@gollent.com. + * Copyright 2012-2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 13712e3a6f..ef30d85c15 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@gollent.com. + * Copyright 2012-2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 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 4e1bfacafd..563f119810 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 47bc151210..78c7542a18 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@gmx.de. - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2015, Rene Gollent, rene@gollent.com. * 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 13ac146365..d17bef1a99 100644 --- a/src/apps/debugger/value/ValueLoader.h +++ b/src/apps/debugger/value/ValueLoader.h @@ -1,4 +1,5 @@ /* + * Copyright 2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 33bde4f59c..d868a07c92 100644 --- a/src/apps/debugger/value/ValueNode.cpp +++ b/src/apps/debugger/value/ValueNode.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 c61f252159..05f924a859 100644 --- a/src/apps/debugger/value/ValueNode.h +++ b/src/apps/debugger/value/ValueNode.h @@ -1,4 +1,5 @@ /* + * Copyright 2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. */ @@ -11,6 +12,7 @@ #include +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 37e80a3b63..3b85465f5a 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@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 d1dc16e3a1..009fb92070 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@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 301361e66e..f416145355 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@gollent.com. + * Copyright 2013-2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 242954dfcf..8bcbf6afbd 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@gollent.com. + * Copyright 2013-2015, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 147dccde2f..4a5a52dedf 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@gollent.com + * Copyright 2012-2015, Rene Gollent, rene@gollent.com * 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 ce34e013e0..6a2e2b3c6c 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@gollent.com. + * Copyright 2012-2015, Rene Gollent, rene@gollent.com. * 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 0da34fed86..3a3b1a7527 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@gollent.com + * Copyright 2011-2015, Rene Gollent, rene@gollent.com * 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(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 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 22768f5cba..dfe55e673c 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@gollent.com. + * Copyright 2011-2015, Rene Gollent, rene@gollent.com. * 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 6e208e754a..c5dcc61b49 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@gollent.com. * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. * 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 891a07a22e..51a705ceb6 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@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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;