[Lldb-commits] [lldb] r132586 - in /lldb/trunk: include/lldb/Target/Thread.h source/Plugins/Process/Linux/LinuxThread.cpp source/Plugins/Process/Linux/LinuxThread.h source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp source/Plugins/Process/gdb-remote/ThreadGDBRemote.h source/Target/Thread.cpp

Peter Collingbourne peter at pcc.me.uk
Fri Jun 3 13:40:54 PDT 2011


Author: pcc
Date: Fri Jun  3 15:40:54 2011
New Revision: 132586

URL: http://llvm.org/viewvc/llvm-project?rev=132586&view=rev
Log:
Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread base class

Modified:
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
    lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
    lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Fri Jun  3 15:40:54 2011
@@ -751,10 +751,10 @@
     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;

Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Fri Jun  3 15:40:54 2011
@@ -85,18 +85,6 @@
     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)
 {

Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Fri Jun  3 15:40:54 2011
@@ -54,13 +54,6 @@
 
     void Notify(const ProcessMessage &message);
 
-protected:
-    virtual bool
-    SaveFrameZeroState(RegisterCheckpoint &checkpoint);
-
-    virtual bool
-    RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
-
 private:
     RegisterContextLinux *
     GetRegisterContextLinux ()

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Fri Jun  3 15:40:54 2011
@@ -633,35 +633,6 @@
 
 
 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())

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h Fri Jun  3 15:40:54 2011
@@ -118,12 +118,6 @@
     GetPrivateStopReason ();
 
 protected:
-    virtual bool
-    SaveFrameZeroState (RegisterCheckpoint &checkpoint);
-
-    virtual bool
-    RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
-
     bool
     GetIdentifierInfo ();
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Fri Jun  3 15:40:54 2011
@@ -221,32 +221,6 @@
     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 ()
 {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h Fri Jun  3 15:40:54 2011
@@ -99,12 +99,6 @@
     
     friend class ProcessGDBRemote;
 
-    virtual bool
-    SaveFrameZeroState (RegisterCheckpoint &checkpoint);
-
-    virtual bool
-    RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
-
     bool
     PrivateSetRegisterValue (uint32_t reg, 
                              StringExtractor &response);

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=132586&r1=132585&r2=132586&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Fri Jun  3 15:40:54 2011
@@ -1156,7 +1156,34 @@
                                           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"
 //--------------------------------------------------------------





More information about the lldb-commits mailing list