From 43060a58fa461430c98c7d24c3e71179e160a5ab Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 30 Oct 2014 16:48:00 -0400 Subject: [PATCH] Debugger: Minor tweak to ExpressionEvaluationJob. - ExpressionEvaluationJob now stores the final result value, and provides an accessor to it. --- src/apps/debugger/jobs/ExpressionEvaluationJob.cpp | 14 +++++++------- src/apps/debugger/jobs/Jobs.h | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/apps/debugger/jobs/ExpressionEvaluationJob.cpp b/src/apps/debugger/jobs/ExpressionEvaluationJob.cpp index b98f783a84..22bd03e25d 100644 --- a/src/apps/debugger/jobs/ExpressionEvaluationJob.cpp +++ b/src/apps/debugger/jobs/ExpressionEvaluationJob.cpp @@ -34,7 +34,8 @@ ExpressionEvaluationJob::ExpressionEvaluationJob(Team* team, fResultType(resultType), fFrame(frame), fThread(thread), - fManager(NULL) + fManager(NULL), + fResultValue(NULL) { fLanguage->AcquireReference(); if (fFrame != NULL) @@ -53,6 +54,8 @@ ExpressionEvaluationJob::~ExpressionEvaluationJob() fThread->ReleaseReference(); if (fManager != NULL) fManager->ReleaseReference(); + if (fResultValue != NULL) + fResultValue->ReleaseReference(); } @@ -66,8 +69,6 @@ ExpressionEvaluationJob::Key() const status_t ExpressionEvaluationJob::Do() { - - Value* value = NULL; BReference reference; status_t result = B_OK; if (fFrame != NULL && fManager == NULL) { @@ -85,18 +86,17 @@ ExpressionEvaluationJob::Do() ValueNode* neededNode = NULL; result = fLanguage->EvaluateExpression(fExpression, - fResultType, fManager, value, neededNode); + fResultType, fManager, fResultValue, neededNode); if (neededNode != NULL) { result = ResolveNodeValue(neededNode); if (State() == JOB_STATE_WAITING) return B_OK; - else if (value != NULL) - reference.SetTo(value, true); // if result != B_OK, fall through } AutoLocker teamLocker(fTeam); - fTeam->NotifyExpressionEvaluated(fExpression.String(), result, value); + fTeam->NotifyExpressionEvaluated(fExpression.String(), result, + fResultValue); return B_OK; } diff --git a/src/apps/debugger/jobs/Jobs.h b/src/apps/debugger/jobs/Jobs.h index 6ae378e5a8..c94c0918f2 100644 --- a/src/apps/debugger/jobs/Jobs.h +++ b/src/apps/debugger/jobs/Jobs.h @@ -245,6 +245,8 @@ public: virtual const JobKey& Key() const; virtual status_t Do(); + Value* GetResultValue() const { return fResultValue; } + private: status_t ResolveNodeValue(ValueNode* node); @@ -260,6 +262,7 @@ private: StackFrame* fFrame; Thread* fThread; ValueNodeManager* fManager; + Value* fResultValue; };