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/Target/Target.cpp b/source/Target/Target.cpp
index 6f5858a..f89f5e4 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -961,7 +961,11 @@
     {
         // Make sure we aren't just trying to see the value of a persistent 
         // variable (something like "$0")
-        lldb::ClangExpressionVariableSP persistent_var_sp (m_persistent_variables.GetVariable (expr_cstr));
+        lldb::ClangExpressionVariableSP persistent_var_sp;
+        // Only check for persistent variables the expression starts with a '$' 
+        if (expr_cstr[0] == '$')
+            persistent_var_sp = m_persistent_variables.GetVariable (expr_cstr);
+
         if (persistent_var_sp)
         {
             result_valobj_sp = persistent_var_sp->GetValueObject ();