diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.cpp b/src/apps/debugger/debug_managers/ValueNodeManager.cpp index 20f6808458..2755bc8468 100644 --- a/src/apps/debugger/debug_managers/ValueNodeManager.cpp +++ b/src/apps/debugger/debug_managers/ValueNodeManager.cpp @@ -17,12 +17,14 @@ #include "VariableValueNodeChild.h" -ValueNodeManager::ValueNodeManager() +ValueNodeManager::ValueNodeManager(bool addFrameNodes) : + fAddFrameNodes(addFrameNodes), fContainer(NULL), fStackFrame(NULL), fThread(NULL) { + SetStackFrame(NULL, NULL); } @@ -50,22 +52,22 @@ ValueNodeManager::SetStackFrame(Thread* thread, fStackFrame = stackFrame; fThread = thread; - if (fStackFrame != NULL) { - fContainer = new(std::nothrow) ValueNodeContainer; - if (fContainer == NULL) - return B_NO_MEMORY; + fContainer = new(std::nothrow) ValueNodeContainer; + if (fContainer == NULL) + return B_NO_MEMORY; - status_t error = fContainer->Init(); - if (error != B_OK) { - delete fContainer; - fContainer = NULL; - return error; - } + status_t error = fContainer->Init(); + if (error != B_OK) { + delete fContainer; + fContainer = NULL; + return error; + } - AutoLocker containerLocker(fContainer); + AutoLocker containerLocker(fContainer); - fContainer->AddListener(this); + fContainer->AddListener(this); + if (fStackFrame != NULL && fAddFrameNodes) { for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i); i++) { _AddNode(variable); diff --git a/src/apps/debugger/debug_managers/ValueNodeManager.h b/src/apps/debugger/debug_managers/ValueNodeManager.h index 603648affb..d4511d2f08 100644 --- a/src/apps/debugger/debug_managers/ValueNodeManager.h +++ b/src/apps/debugger/debug_managers/ValueNodeManager.h @@ -17,7 +17,7 @@ class Variable; class ValueNodeManager : public BReferenceable, private ValueNodeContainer::Listener { public: - ValueNodeManager(); + ValueNodeManager(bool addFrameNodes = true); virtual ~ValueNodeManager(); status_t SetStackFrame(Thread* thread, @@ -45,6 +45,7 @@ private: status_t _CreateValueNode(ValueNodeChild* nodeChild); private: + bool fAddFrameNodes; ValueNodeContainer* fContainer; StackFrame* fStackFrame; Thread* fThread;