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/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 05d2b0b..2f2d0ce 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -713,13 +713,9 @@
{
ClangExpressionVariableSP member_sp(m_struct_members.GetVariableAtIndex(member_index));
- ClangExpressionVariableSP entity_sp (m_found_entities.GetVariable(member_sp->GetName()));
-
- ClangExpressionVariableSP persistent_var_sp (persistent_vars.GetVariable(member_sp->GetName()));
-
- if (entity_sp)
+ if (m_found_entities.ContainsVariable (member_sp))
{
- RegisterInfo *reg_info = entity_sp->GetRegisterInfo ();
+ RegisterInfo *reg_info = member_sp->GetRegisterInfo ();
if (reg_info)
{
// This is a register variable
@@ -752,34 +748,36 @@
return false;
}
}
- else if (persistent_var_sp)
- {
- if (member_sp->GetName() == m_struct_vars->m_result_name)
- {
- if (!dematerialize)
- continue;
-
- if (log)
- log->PutCString("Found result member in the struct");
-
- if (result_sp_ptr)
- *result_sp_ptr = member_sp;
- }
-
- if (log)
- log->Printf("Searched for persistent variable %s and found %s", member_sp->GetName().GetCString(), persistent_var_sp->GetName().GetCString());
-
- if (!DoMaterializeOnePersistentVariable (dematerialize,
- exe_ctx,
- persistent_var_sp,
- m_material_vars->m_materialized_location + member_sp->m_jit_vars->m_offset,
- err))
- return false;
- }
else
{
- err.SetErrorStringWithFormat("Unexpected variable %s", member_sp->GetName().GetCString());
- return false;
+ // No need to look for presistent variables if the name doesn't start
+ // with with a '$' character...
+ if (member_sp->GetName().AsCString ("!")[0] == '$' && persistent_vars.ContainsVariable(member_sp))
+ {
+ if (member_sp->GetName() == m_struct_vars->m_result_name)
+ {
+ if (!dematerialize)
+ continue;
+
+ if (log)
+ log->PutCString("Found result member in the struct");
+
+ if (result_sp_ptr)
+ *result_sp_ptr = member_sp;
+ }
+
+ if (!DoMaterializeOnePersistentVariable (dematerialize,
+ exe_ctx,
+ member_sp,
+ m_material_vars->m_materialized_location + member_sp->m_jit_vars->m_offset,
+ err))
+ return false;
+ }
+ else
+ {
+ err.SetErrorStringWithFormat("Unexpected variable %s", member_sp->GetName().GetCString());
+ return false;
+ }
}
}