Put more smarts into the RegisterContext base class. Now the base class has
a method:

    void RegisterContext::InvalidateIfNeeded (bool force);

Each time this function is called, when "force" is false, it will only call
the pure virtual "virtual void RegisterContext::InvalideAllRegisters()" if
the register context's stop ID doesn't match that of the process. When the
stop ID doesn't match, or "force" is true, the base class will clear its
cached registers and the RegisterContext will update its stop ID to match
that of the process. This helps make it easier to correctly flush the register
context (possibly from multiple locations depending on when and where new
registers are availabe) without inadvertently clearing the register cache 
when it doesn't need to be.

Modified the ProcessGDBRemote plug-in to be much more efficient when it comes
to:
- caching the expedited registers in the stop reply packets (we were ignoring
  these before and it was causing us to read at least three registers every
  time we stopped that were already supplied in the stop reply packet).
- When a thread has no stop reason, don't keep asking for the thread stopped
  info. Prior to this fix we would continually send a qThreadStopInfo packet
  over and over when any thread stop info was requested. We now note the stop
  ID that the stop info was requested for and avoid multiple requests.

Cleaned up some of the expression code to not look for ClangExpressionVariable
objects up by name since they are now shared pointers and we can just look for
the exact pointer match and avoid possible errors.

Fixed an bug in the ValueObject code that would cause children to not be 
displayed.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123127 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/UnwindLLDB.cpp b/source/Plugins/Process/Utility/UnwindLLDB.cpp
index 75f92bb..30c867e 100644
--- a/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -35,6 +35,7 @@
     {
 //#define DEBUG_FRAME_SPEED 1
 #if DEBUG_FRAME_SPEED
+#define FRAME_COUNT 10000
         TimeValue time_value (TimeValue::Now());
 #endif
         if (!AddFirstFrame ())
@@ -42,11 +43,15 @@
         while (AddOneMoreFrame ())
         {
 #if DEBUG_FRAME_SPEED
-            if ((m_frames.size() % 10000) == 0)
+            if ((m_frames.size() % FRAME_COUNT) == 0)
             {
                 TimeValue now(TimeValue::Now());
                 uint64_t delta_t = now - time_value;
-                printf ("10000 frames in %llu.%09llu ms\n", delta_t / NSEC_PER_SEC, delta_t % NSEC_PER_SEC);
+                printf ("%u frames in %llu.%09llu ms (%g frames/sec)\n", 
+                        FRAME_COUNT,
+                        delta_t / NSEC_PER_SEC, 
+                        delta_t % NSEC_PER_SEC,
+                        (float)FRAME_COUNT / ((float)delta_t / (float)NSEC_PER_SEC));
                 time_value = now;
             }
 #endif