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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user