[Lldb-commits] [lldb] r134656 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Sean Callanan
scallanan at apple.com
Thu Jul 7 16:05:43 PDT 2011
Author: spyffe
Date: Thu Jul 7 18:05:43 2011
New Revision: 134656
URL: http://llvm.org/viewvc/llvm-project?rev=134656&view=rev
Log:
Added checks to the expresssion parser which make
searching for variables and symbols in the target
more robust. These checks prevent variables from
being reported as existing if they cannot actually
be evaluated in the current context.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=134656&r1=134655&r2=134656&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Jul 7 18:05:43 2011
@@ -552,6 +552,9 @@
else
return false;
+ if (!func_so_addr || !func_so_addr->IsValid())
+ return false;
+
func_addr = func_so_addr->GetCallableLoadAddress (m_parser_vars->m_exe_ctx->target);
return true;
@@ -573,6 +576,10 @@
sc_list.GetContextAtIndex(i, sym_ctx);
const Address *sym_address = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress();
+
+ if (!sym_address || !sym_address->IsValid())
+ return LLDB_INVALID_ADDRESS;
+
if (sym_address)
{
switch (sym_ctx.symbol->GetType())
@@ -1261,7 +1268,7 @@
NULL));
}
else if (sym)
- {
+ {
location_value.reset(new Value);
addr_t location_load_addr = GetSymbolAddress(*exe_ctx.target, name);
@@ -1591,6 +1598,11 @@
var_sp = program_globals.GetVariableAtIndex (0);
}
}
+
+ if (!var_sp ||
+ !var_sp->IsInScope(&frame) ||
+ !var_sp->LocationIsValidForFrame (&frame))
+ return lldb::VariableSP();
if (var_sp && type)
{
More information about the lldb-commits
mailing list