mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 01:15:50 +08:00
Handle the case when a variable is only valid in part of the enclosing scope
DWARF stores this information in the DW_AT_start_scope attribute. This CL add support for this attribute and also changes the functions displaying frame variables to only display the variables currently in scope. Differential revision: http://reviews.llvm.org/D17449 llvm-svn: 261858
This commit is contained in:
@@ -131,7 +131,11 @@ SBBlock::AppendVariables (bool can_create, bool get_parent_variables, lldb_priva
|
||||
if (IsValid())
|
||||
{
|
||||
bool show_inline = true;
|
||||
m_opaque_ptr->AppendVariables (can_create, get_parent_variables, show_inline, var_list);
|
||||
m_opaque_ptr->AppendVariables (can_create,
|
||||
get_parent_variables,
|
||||
show_inline,
|
||||
[](Variable*) { return true; },
|
||||
var_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -789,9 +789,10 @@ SBFrame::FindVariable (const char *name, lldb::DynamicValueType use_dynamic)
|
||||
const bool get_parent_variables = true;
|
||||
const bool stop_if_block_is_inlined_function = true;
|
||||
|
||||
if (sc.block->AppendVariables (can_create,
|
||||
if (sc.block->AppendVariables (can_create,
|
||||
get_parent_variables,
|
||||
stop_if_block_is_inlined_function,
|
||||
[frame](Variable* v) { return v->IsInScope(frame); },
|
||||
&variable_list))
|
||||
{
|
||||
var_sp = variable_list.FindVariable (ConstString(name));
|
||||
@@ -887,6 +888,7 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
|
||||
sc.block->AppendVariables(can_create,
|
||||
get_parent_variables,
|
||||
stop_if_block_is_inlined_function,
|
||||
[frame](Variable* v) { return v->IsInScope(frame); },
|
||||
&variable_list);
|
||||
if (value_type == eValueTypeVariableGlobal)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user