From 6a7eaa2a75a856be8b7e631d7cfca7ceec14bdce Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 5 Nov 2014 17:27:13 -0500 Subject: [PATCH] Debugger: Add ExpressionValues to VariablesViewState. - VariablesViewState is now able to optionally store previous values for expression nodes. --- .../gui/model/VariablesViewState.cpp | 22 +++++++++++++++++-- .../gui/model/VariablesViewState.h | 8 ++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/model/VariablesViewState.cpp b/src/apps/debugger/user_interface/gui/model/VariablesViewState.cpp index 99dc79dd69..081f7591f6 100644 --- a/src/apps/debugger/user_interface/gui/model/VariablesViewState.cpp +++ b/src/apps/debugger/user_interface/gui/model/VariablesViewState.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2014, 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 +#include "ExpressionValues.h" #include "FunctionID.h" #include "StackFrameValues.h" #include "Type.h" @@ -164,7 +165,8 @@ struct VariablesViewState::InfoEntryHashDefinition { VariablesViewState::VariablesViewState() : fNodeInfos(NULL), - fValues(NULL) + fValues(NULL), + fExpressionValues(NULL) { } @@ -201,6 +203,22 @@ VariablesViewState::SetValues(StackFrameValues* values) } +void +VariablesViewState::SetExpressionValues(ExpressionValues* values) +{ + if (fExpressionValues == values) + return; + + if (fExpressionValues != NULL) + fExpressionValues->ReleaseReference(); + + fExpressionValues = values; + + if (fExpressionValues != NULL) + fExpressionValues->AcquireReference(); +} + + const VariablesViewNodeInfo* VariablesViewState::GetNodeInfo(ObjectID* variable, const TypeComponentPath* path) const diff --git a/src/apps/debugger/user_interface/gui/model/VariablesViewState.h b/src/apps/debugger/user_interface/gui/model/VariablesViewState.h index 95b5f2996b..a36dd8bebc 100644 --- a/src/apps/debugger/user_interface/gui/model/VariablesViewState.h +++ b/src/apps/debugger/user_interface/gui/model/VariablesViewState.h @@ -1,5 +1,5 @@ /* - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2014, Rene Gollent, rene@gollent.com. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. */ @@ -12,6 +12,7 @@ #include +class ExpressionValues; class ObjectID; class StackFrameValues; class Type; @@ -59,6 +60,10 @@ public: { return fValues; } void SetValues(StackFrameValues* values); + ExpressionValues* GetExpressionValues() const + { return fExpressionValues; } + void SetExpressionValues(ExpressionValues* values); + const VariablesViewNodeInfo* GetNodeInfo(ObjectID* variable, const TypeComponentPath* path) const; inline const VariablesViewNodeInfo* GetNodeInfo(ObjectID* variable, @@ -82,6 +87,7 @@ private: private: NodeInfoTable* fNodeInfos; StackFrameValues* fValues; + ExpressionValues* fExpressionValues; };