summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-06-03 20:40:54 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-06-03 20:40:54 +0000
commit5a6fa540dcc0a86b6e4412ad27bbb0a732bc859b (patch)
tree8dbe47be4a30cf36fd9c11f5259b5c29bf59dde5
parent70969ef10270d3be63498be123ef98ac5dcf2f57 (diff)
downloadbcm5719-llvm-5a6fa540dcc0a86b6e4412ad27bbb0a732bc859b.tar.gz
bcm5719-llvm-5a6fa540dcc0a86b6e4412ad27bbb0a732bc859b.zip
Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread base class
llvm-svn: 132586
-rw-r--r--lldb/include/lldb/Target/Thread.h4
-rw-r--r--lldb/source/Plugins/Process/Linux/LinuxThread.cpp12
-rw-r--r--lldb/source/Plugins/Process/Linux/LinuxThread.h7
-rw-r--r--lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp29
-rw-r--r--lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp26
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h6
-rw-r--r--lldb/source/Target/Thread.cpp27
8 files changed, 29 insertions, 88 deletions
diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h
index 03fb414534d..395bff3e72d 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -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;
diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
index bac9d48c3ce..c6e0e553e44 100644
--- a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -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)
{
diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.h b/lldb/source/Plugins/Process/Linux/LinuxThread.h
index cafc83a7c87..e7d23b840f9 100644
--- a/lldb/source/Plugins/Process/Linux/LinuxThread.h
+++ b/lldb/source/Plugins/Process/Linux/LinuxThread.h
@@ -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 ()
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
index 66bd5366f60..08df10c1913 100644
--- a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
@@ -633,35 +633,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)
{
if (bp != NULL && bp->IsHardware())
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
index 3f122c234ab..25ca7c88b49 100644
--- a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
+++ b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
@@ -118,12 +118,6 @@ public:
GetPrivateStopReason ();
protected:
- virtual bool
- SaveFrameZeroState (RegisterCheckpoint &checkpoint);
-
- virtual bool
- RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
-
bool
GetIdentifierInfo ();
diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
index 8ed7edaedb4..0be5edf096f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -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 ()
{
diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
index c085b6c1485..2fdb4d7cb10 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
@@ -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);
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 288694bfffd..b1a3c15b6b3 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -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"
//--------------------------------------------------------------
OpenPOWER on IntegriCloud