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.
This commit is contained in:
Rene Gollent
2015-07-24 17:08:53 -04:00
parent 9b0d97576d
commit 7d25ab995d
6 changed files with 134 additions and 3 deletions
+19 -1
View File
@@ -1035,13 +1035,31 @@ TeamDebugger::ValueNodeValueRequested(CpuState* cpuState,
status_t error = fWorker->ScheduleJob(
new(std::nothrow) ResolveValueNodeValueJob(fDebuggerInterface,
fDebuggerInterface->GetArchitecture(), cpuState,
fTeam->GetTeamTypeInformation(), container, valueNode), this);
fTeam->GetTeamTypeInformation(), container, valueNode), this);
if (error != B_OK) {
// scheduling failed -- set the value to invalid
valueNode->SetLocationAndValue(NULL, NULL, error);
}
}
void
TeamDebugger::ValueNodeWriteRequested(ValueNode* node, CpuState* state,
Value* newValue)
{
// schedule the job
status_t error = fWorker->ScheduleJob(
new(std::nothrow) WriteValueNodeValueJob(fDebuggerInterface,
fDebuggerInterface->GetArchitecture(), state,
fTeam->GetTeamTypeInformation(), node, newValue), this);
if (error != B_OK) {
BString message;
message.SetToFormat("Request to write new value for variable %s "
"failed: %s.\n", node->Name().String(), strerror(error));
fUserInterface->NotifyUser("Error", message.String(),
USER_NOTIFICATION_ERROR);
}
}
void
TeamDebugger::ThreadActionRequested(thread_id threadID,