forked from OSchip/llvm-project
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. llvm-svn: 134656
This commit is contained in:
parent
7fcce6829d
commit
c6466fc9ab
|
@ -552,6 +552,9 @@ ClangExpressionDeclMap::GetFunctionAddress
|
|||
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 @@ ClangExpressionDeclMap::GetSymbolAddress (Target &target, const ConstString &nam
|
|||
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())
|
||||
|
@ -1592,6 +1599,11 @@ ClangExpressionDeclMap::FindVariableInScope
|
|||
}
|
||||
}
|
||||
|
||||
if (!var_sp ||
|
||||
!var_sp->IsInScope(&frame) ||
|
||||
!var_sp->LocationIsValidForFrame (&frame))
|
||||
return lldb::VariableSP();
|
||||
|
||||
if (var_sp && type)
|
||||
{
|
||||
if (type->GetASTContext() == var_sp->GetType()->GetClangAST())
|
||||
|
|
Loading…
Reference in New Issue