From bcf1217e28c9cacf72a53e4778117f38af027d9e Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 28 Oct 2010 00:56:11 +0000 Subject: [PATCH] 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 --- lldb/lldb.xcodeproj/project.pbxproj | 1 - lldb/source/Commands/CommandObjectFrame.cpp | 2 +- .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 17 +++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 265e0dae6f7a..40bf0182482a 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -2501,7 +2501,6 @@ isa = PBXProject; buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */; compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( en, diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 59db3fccc3fd..8edeb69a8453 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -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 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."}, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 690d06181758..8b6f4097ec42 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -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; }