return m_target;
}
+ //------------------------------------------------------------------
+ /// Flush all data in the process.
+ ///
+ /// Flush the memory caches, all threads, and any other cached data
+ /// in the process.
+ ///
+ /// This function can be called after a world changing event like
+ /// adding a new symbol file, or after the process makes a large
+ /// context switch (from boot ROM to booted into an OS).
+ //------------------------------------------------------------------
+ void
+ Flush ();
//------------------------------------------------------------------
/// Get accessor for the current process state.
Vote
ShouldReportRun (Event *event_ptr);
+ void
+ Flush ();
+
// Return whether this thread matches the specification in ThreadSpec. This is a virtual
// method because at some point we may extend the thread spec with a platform specific
// dictionary of attributes, which then only the platform specific Thread implementation
Clear();
void
+ Flush();
+
+ void
Destroy();
// Note that "idx" is not the same as the "thread_index". It is a zero
{
if (reg_ctx->WriteRegister (reg_info, reg_value))
{
+ // Toss all frames and anything else in the thread
+ // after a register has been written.
+ exe_ctx.GetThreadRef().Flush();
result.SetStatus (eReturnStatusSuccessFinishNoResult);
return true;
}
Execute (Args& args,
CommandReturnObject &result)
{
- Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+ ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+ Target *target = exe_ctx.GetTargetPtr();
if (target == NULL)
{
result.AppendError ("invalid target, create a debug target using the 'target create' command");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
+ bool flush = false;
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
result.AppendError ("one or more symbol file paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
}
else
{
ModuleList module_list;
module_list.Append (old_module_sp);
target->ModulesDidLoad (module_list);
+ flush = true;
}
}
else
{
result.AppendError ("one or more executable image paths must be specified");
result.SetStatus (eReturnStatusFailed);
- return false;
+ break;
}
result.SetStatus (eReturnStatusSuccessFinishResult);
}
}
}
}
+
+ if (flush)
+ {
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process)
+ process->Flush();
+ }
}
return result.Succeeded();
}
m_pre_resume_actions.clear();
}
+void
+Process::Flush ()
+{
+ m_thread_list.Flush();
+}
+
//--------------------------------------------------------------
// class Process::SettingsController
//--------------------------------------------------------------
}
+void
+Thread::Flush ()
+{
+ ClearStackFrames ();
+ m_reg_context_sp.reset();
+}
+
+
#pragma mark "Thread::SettingsController"
//--------------------------------------------------------------
// class Thread::SettingsController
}
}
+void
+ThreadList::Flush ()
+{
+ Mutex::Locker locker(m_threads_mutex);
+ collection::iterator pos, end = m_threads.end();
+ for (pos = m_threads.begin(); pos != end; ++pos)
+ (*pos)->Flush ();
+}