-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugger: Add hook for variable value writing.
WriteValueNodeJob: - Implement async job that creates a ValueWriter to update a variable value on request. UserInterfaceListener: - Add hook for requesting that a node be updated with a new value. Implement in TeamDebugger by scheduling a WriteValueNodeJob.
- Loading branch information
Showing
6 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright 2015, Rene Gollent, rene@gollent.com. | ||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. | ||
* Distributed under the terms of the MIT License. | ||
*/ | ||
|
||
#include "Jobs.h" | ||
|
||
#include <AutoLocker.h> | ||
|
||
#include "Architecture.h" | ||
#include "CpuState.h" | ||
#include "DebuggerInterface.h" | ||
#include "TeamTypeInformation.h" | ||
#include "Tracing.h" | ||
#include "Value.h" | ||
#include "ValueLocation.h" | ||
#include "ValueNode.h" | ||
#include "ValueNodeContainer.h" | ||
#include "ValueWriter.h" | ||
|
||
|
||
WriteValueNodeValueJob::WriteValueNodeValueJob( | ||
DebuggerInterface* debuggerInterface, Architecture* architecture, | ||
CpuState* cpuState, TeamTypeInformation* typeInformation, | ||
ValueNode* valueNode, Value* newValue) | ||
: | ||
fKey(valueNode, JOB_TYPE_WRITE_VALUE_NODE_VALUE), | ||
fDebuggerInterface(debuggerInterface), | ||
fArchitecture(architecture), | ||
fCpuState(cpuState), | ||
fTypeInformation(typeInformation), | ||
fValueNode(valueNode), | ||
fNewValue(newValue) | ||
{ | ||
if (fCpuState != NULL) | ||
fCpuState->AcquireReference(); | ||
fValueNode->AcquireReference(); | ||
fNewValue->AcquireReference(); | ||
} | ||
|
||
|
||
WriteValueNodeValueJob::~WriteValueNodeValueJob() | ||
{ | ||
if (fCpuState != NULL) | ||
fCpuState->ReleaseReference(); | ||
fValueNode->ReleaseReference(); | ||
fNewValue->ReleaseReference(); | ||
} | ||
|
||
|
||
const JobKey& | ||
WriteValueNodeValueJob::Key() const | ||
{ | ||
return fKey; | ||
} | ||
|
||
|
||
status_t | ||
WriteValueNodeValueJob::Do() | ||
{ | ||
ValueNodeContainer* container = fValueNode->Container(); | ||
if (container == NULL) | ||
return B_BAD_VALUE; | ||
|
||
ValueWriter writer(fArchitecture, fDebuggerInterface, | ||
fCpuState, -1); | ||
|
||
BVariant value; | ||
fNewValue->ToVariant(value); | ||
|
||
status_t error = writer.WriteValue(fValueNode->Location(), value); | ||
if (error != B_OK) | ||
return error; | ||
|
||
AutoLocker<ValueNodeContainer> containerLocker(container); | ||
fValueNode->SetLocationAndValue(fValueNode->Location(), fNewValue, B_OK); | ||
|
||
return B_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters