Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread base class

llvm-svn: 132586
This commit is contained in:
Peter Collingbourne
2011-06-03 20:40:54 +00:00
parent 70969ef102
commit 5a6fa540dc
8 changed files with 29 additions and 88 deletions

View File

@@ -751,10 +751,10 @@ protected:
SetStopInfo (const lldb::StopInfoSP &stop_info_sp);
virtual bool
SaveFrameZeroState (RegisterCheckpoint &checkpoint) = 0;
SaveFrameZeroState (RegisterCheckpoint &checkpoint);
virtual bool
RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint) = 0;
RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
virtual lldb_private::Unwind *
GetUnwinder () = 0;

View File

@@ -85,18 +85,6 @@ LinuxThread::GetRegisterContext()
return m_reg_context_sp;
}
bool
LinuxThread::SaveFrameZeroState(RegisterCheckpoint &checkpoint)
{
return false;
}
bool
LinuxThread::RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint)
{
return false;
}
lldb::RegisterContextSP
LinuxThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame)
{

View File

@@ -54,13 +54,6 @@ public:
void Notify(const ProcessMessage &message);
protected:
virtual bool
SaveFrameZeroState(RegisterCheckpoint &checkpoint);
virtual bool
RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
private:
RegisterContextLinux *
GetRegisterContextLinux ()

View File

@@ -632,35 +632,6 @@ ThreadMacOSX::SetHardwareWatchpoint (const WatchpointLocation *wp)
}
bool
ThreadMacOSX::SaveFrameZeroState (RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
checkpoint.SetStackID(frame_sp->GetStackID());
return frame_sp->GetRegisterContext()->ReadAllRegisterValues (checkpoint.GetData());
}
return false;
}
bool
ThreadMacOSX::RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
bool ret = frame_sp->GetRegisterContext()->WriteAllRegisterValues (checkpoint.GetData());
// Clear out all stack frames as our world just changed.
ClearStackFrames();
frame_sp->GetRegisterContext()->InvalidateIfNeeded(true);
return ret;
}
return false;
}
bool
ThreadMacOSX::ClearHardwareBreakpoint (const BreakpointSite *bp)
{

View File

@@ -118,12 +118,6 @@ public:
GetPrivateStopReason ();
protected:
virtual bool
SaveFrameZeroState (RegisterCheckpoint &checkpoint);
virtual bool
RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
bool
GetIdentifierInfo ();

View File

@@ -221,32 +221,6 @@ ThreadGDBRemote::PrivateSetRegisterValue (uint32_t reg, StringExtractor &respons
return gdb_reg_ctx->PrivateSetRegisterValue (reg, response);
}
bool
ThreadGDBRemote::SaveFrameZeroState (RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
checkpoint.SetStackID(frame_sp->GetStackID());
return frame_sp->GetRegisterContext()->ReadAllRegisterValues (checkpoint.GetData());
}
return false;
}
bool
ThreadGDBRemote::RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
bool ret = frame_sp->GetRegisterContext()->WriteAllRegisterValues (checkpoint.GetData());
frame_sp->GetRegisterContext()->InvalidateIfNeeded(true);
ClearStackFrames();
return ret;
}
return false;
}
lldb::StopInfoSP
ThreadGDBRemote::GetPrivateStopReason ()
{

View File

@@ -99,12 +99,6 @@ protected:
friend class ProcessGDBRemote;
virtual bool
SaveFrameZeroState (RegisterCheckpoint &checkpoint);
virtual bool
RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
bool
PrivateSetRegisterValue (uint32_t reg,
StringExtractor &response);

View File

@@ -1156,7 +1156,34 @@ Thread::GetStackFrameStatus (Stream& strm,
source_lines_after);
}
bool
Thread::SaveFrameZeroState (RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
checkpoint.SetStackID(frame_sp->GetStackID());
return frame_sp->GetRegisterContext()->ReadAllRegisterValues (checkpoint.GetData());
}
return false;
}
bool
Thread::RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint)
{
lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
if (frame_sp)
{
bool ret = frame_sp->GetRegisterContext()->WriteAllRegisterValues (checkpoint.GetData());
// Clear out all stack frames as our world just changed.
ClearStackFrames();
frame_sp->GetRegisterContext()->InvalidateIfNeeded(true);
return ret;
}
return false;
}
#pragma mark "Thread::SettingsController"
//--------------------------------------------------------------