ValueNodeManager: Add flag to control frame variables.

- We now take a flag which determines whether or not to add parameters
  and locals from the frame to the container.
This commit is contained in:
Rene Gollent 2015-11-10 09:12:55 -05:00
parent be32382a6d
commit b4058de7fe
2 changed files with 17 additions and 14 deletions

View File

@ -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<ValueNodeContainer> containerLocker(fContainer);
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
fContainer->AddListener(this);
fContainer->AddListener(this);
if (fStackFrame != NULL && fAddFrameNodes) {
for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i);
i++) {
_AddNode(variable);

View File

@ -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;