Debugger: Minor tweak to ExpressionEvaluationJob.
- ExpressionEvaluationJob now stores the final result value, and provides an accessor to it.
This commit is contained in:
@@ -34,7 +34,8 @@ ExpressionEvaluationJob::ExpressionEvaluationJob(Team* team,
|
|||||||
fResultType(resultType),
|
fResultType(resultType),
|
||||||
fFrame(frame),
|
fFrame(frame),
|
||||||
fThread(thread),
|
fThread(thread),
|
||||||
fManager(NULL)
|
fManager(NULL),
|
||||||
|
fResultValue(NULL)
|
||||||
{
|
{
|
||||||
fLanguage->AcquireReference();
|
fLanguage->AcquireReference();
|
||||||
if (fFrame != NULL)
|
if (fFrame != NULL)
|
||||||
@@ -53,6 +54,8 @@ ExpressionEvaluationJob::~ExpressionEvaluationJob()
|
|||||||
fThread->ReleaseReference();
|
fThread->ReleaseReference();
|
||||||
if (fManager != NULL)
|
if (fManager != NULL)
|
||||||
fManager->ReleaseReference();
|
fManager->ReleaseReference();
|
||||||
|
if (fResultValue != NULL)
|
||||||
|
fResultValue->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -66,8 +69,6 @@ ExpressionEvaluationJob::Key() const
|
|||||||
status_t
|
status_t
|
||||||
ExpressionEvaluationJob::Do()
|
ExpressionEvaluationJob::Do()
|
||||||
{
|
{
|
||||||
|
|
||||||
Value* value = NULL;
|
|
||||||
BReference<Value> reference;
|
BReference<Value> reference;
|
||||||
status_t result = B_OK;
|
status_t result = B_OK;
|
||||||
if (fFrame != NULL && fManager == NULL) {
|
if (fFrame != NULL && fManager == NULL) {
|
||||||
@@ -85,18 +86,17 @@ ExpressionEvaluationJob::Do()
|
|||||||
|
|
||||||
ValueNode* neededNode = NULL;
|
ValueNode* neededNode = NULL;
|
||||||
result = fLanguage->EvaluateExpression(fExpression,
|
result = fLanguage->EvaluateExpression(fExpression,
|
||||||
fResultType, fManager, value, neededNode);
|
fResultType, fManager, fResultValue, neededNode);
|
||||||
if (neededNode != NULL) {
|
if (neededNode != NULL) {
|
||||||
result = ResolveNodeValue(neededNode);
|
result = ResolveNodeValue(neededNode);
|
||||||
if (State() == JOB_STATE_WAITING)
|
if (State() == JOB_STATE_WAITING)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
else if (value != NULL)
|
|
||||||
reference.SetTo(value, true);
|
|
||||||
// if result != B_OK, fall through
|
// if result != B_OK, fall through
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoLocker<Team> teamLocker(fTeam);
|
AutoLocker<Team> teamLocker(fTeam);
|
||||||
fTeam->NotifyExpressionEvaluated(fExpression.String(), result, value);
|
fTeam->NotifyExpressionEvaluated(fExpression.String(), result,
|
||||||
|
fResultValue);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,6 +245,8 @@ public:
|
|||||||
virtual const JobKey& Key() const;
|
virtual const JobKey& Key() const;
|
||||||
virtual status_t Do();
|
virtual status_t Do();
|
||||||
|
|
||||||
|
Value* GetResultValue() const { return fResultValue; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
status_t ResolveNodeValue(ValueNode* node);
|
status_t ResolveNodeValue(ValueNode* node);
|
||||||
|
|
||||||
@@ -260,6 +262,7 @@ private:
|
|||||||
StackFrame* fFrame;
|
StackFrame* fFrame;
|
||||||
Thread* fThread;
|
Thread* fThread;
|
||||||
ValueNodeManager* fManager;
|
ValueNodeManager* fManager;
|
||||||
|
Value* fResultValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user