Changed the formerly pure virtual function:

namespace lldb_private {
    class Thread
    {
        virtual lldb::StopInfoSP
        GetPrivateStopReason() = 0;
    };
}

To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function:

namespace lldb_private {
    class Thread
    {
        virtual bool
        CalculateStopInfo() = 0;
    }
}

This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The  lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings.

Also renamed:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopReason();

To:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopInfo();

Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads).

llvm-svn: 181501
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 0302f93..0008dbf 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1770,7 +1770,7 @@
                     for (size_t i = 0; i < num_threads; i++)
                     {
                         ThreadSP thread_sp = threads.GetThreadAtIndex(i);
-                        StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+                        StopInfoSP stop_info_sp = thread_sp->GetPrivateStopInfo();
                         StopReason reason = eStopReasonInvalid;
                         if (stop_info_sp)
                             reason = stop_info_sp->GetStopReason();
@@ -1805,7 +1805,7 @@
                         for (size_t i = 0; i < num_threads; i++)
                         {
                             ThreadSP thread_sp = threads.GetThreadAtIndex(i);
-                            StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+                            StopInfoSP stop_info_sp = thread_sp->GetPrivateStopInfo();
                             StopReason reason = eStopReasonInvalid;
                             if (stop_info_sp)
                                 reason = stop_info_sp->GetStopReason();