<rdar://problem/11386214>
<rdar://problem/11455913> "target symbol add" should flush the cached frames "register write" should flush the thread state in case registers modifications change stack llvm-svn: 157042
This commit is contained in:
parent
f34358e90b
commit
fa559e5c6e
|
@ -2269,6 +2269,18 @@ public:
|
|||
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.
|
||||
|
|
|
@ -274,6 +274,9 @@ public:
|
|||
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
|
||||
|
|
|
@ -59,6 +59,9 @@ public:
|
|||
void
|
||||
Clear();
|
||||
|
||||
void
|
||||
Flush();
|
||||
|
||||
void
|
||||
Destroy();
|
||||
|
||||
|
|
|
@ -425,6 +425,9 @@ public:
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -3585,21 +3585,21 @@ public:
|
|||
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
|
||||
{
|
||||
|
@ -3633,13 +3633,14 @@ public:
|
|||
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);
|
||||
}
|
||||
|
@ -3661,6 +3662,13 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flush)
|
||||
{
|
||||
Process *process = exe_ctx.GetProcessPtr();
|
||||
if (process)
|
||||
process->Flush();
|
||||
}
|
||||
}
|
||||
return result.Succeeded();
|
||||
}
|
||||
|
|
|
@ -4707,6 +4707,12 @@ Process::ClearPreResumeActions ()
|
|||
m_pre_resume_actions.clear();
|
||||
}
|
||||
|
||||
void
|
||||
Process::Flush ()
|
||||
{
|
||||
m_thread_list.Flush();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// class Process::SettingsController
|
||||
//--------------------------------------------------------------
|
||||
|
|
|
@ -1410,6 +1410,14 @@ Thread::GetUnwinder ()
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
Thread::Flush ()
|
||||
{
|
||||
ClearStackFrames ();
|
||||
m_reg_context_sp.reset();
|
||||
}
|
||||
|
||||
|
||||
#pragma mark "Thread::SettingsController"
|
||||
//--------------------------------------------------------------
|
||||
// class Thread::SettingsController
|
||||
|
|
|
@ -605,4 +605,12 @@ ThreadList::Update (ThreadList &rhs)
|
|||
}
|
||||
}
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue