Fixed the "frame variable -G NAME" that would print global

variables by name. It was accidentally getting all the globals
for the compile unit that contained the global variable named
NAME.

llvm-svn: 117516
This commit is contained in:
Greg Clayton 2010-10-28 00:56:11 +00:00
parent c6d136cba1
commit bcf1217e28
3 changed files with 10 additions and 10 deletions

View File

@ -2501,7 +2501,6 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,

View File

@ -847,7 +847,7 @@ CommandObjectFrameVariable::CommandOptions::g_option_table[] =
{ LLDB_OPT_SET_1, false, "show-types", 't', no_argument, NULL, 0, eArgTypeNone, "Show variable types when dumping values."},
{ LLDB_OPT_SET_1, false, "no-summary", 'y', no_argument, NULL, 0, eArgTypeNone, "Omit summary information."},
{ LLDB_OPT_SET_1, false, "scope", 's', no_argument, NULL, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."},
{ LLDB_OPT_SET_1, false, "objc", 'o', no_argument, NULL, 0, eArgTypeNone, "When looking up a variable by name (--name), print as an Objective-C object."},
{ LLDB_OPT_SET_1, false, "objc", 'o', no_argument, NULL, 0, eArgTypeNone, "When looking up a variable by name, print as an Objective-C object."},
{ LLDB_OPT_SET_1, false, "ptr-depth", 'p', required_argument, NULL, 0, eArgTypeCount, "The number of pointers to be traversed when dumping values (default is zero)."},
{ LLDB_OPT_SET_1, false, "regex", 'r', no_argument, NULL, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."},
{ LLDB_OPT_SET_1, false, "flat", 'f', no_argument, NULL, 0, eArgTypeNone, "Display results in a flat format that uses expression paths for each variable or member."},

View File

@ -3709,7 +3709,12 @@ SymbolFileDWARF::ParseVariables
dw_tag_t tag = die->Tag();
// Check to see if we have already parsed this variable or constant?
if (m_die_to_variable_sp[die].get() == NULL)
if (m_die_to_variable_sp[die])
{
if (cc_variable_list)
cc_variable_list->AddVariable (m_die_to_variable_sp[die]);
}
else
{
// We haven't already parsed it, lets do that now.
if ((tag == DW_TAG_variable) ||
@ -3720,6 +3725,8 @@ SymbolFileDWARF::ParseVariables
if (var_sp)
{
variables->AddVariable(var_sp);
if (cc_variable_list)
cc_variable_list->AddVariable (var_sp);
++vars_added;
}
}
@ -3729,8 +3736,7 @@ SymbolFileDWARF::ParseVariables
if (!skip_children && parse_children && die->HasChildren())
{
vars_added += ParseVariables(sc, dwarf_cu, func_low_pc, die->GetFirstChild(), true, true);
//vars_added += ParseVariables(sc, dwarf_cu, die->GetFirstChild(), parse_siblings, parse_children);
vars_added += ParseVariables(sc, dwarf_cu, func_low_pc, die->GetFirstChild(), true, true, cc_variable_list);
}
if (parse_siblings)
@ -3739,11 +3745,6 @@ SymbolFileDWARF::ParseVariables
die = NULL;
}
if (cc_variable_list)
{
cc_variable_list->AddVariables(variables.get());
}
return vars_added;
}