summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorRavitheja Addepally <ravitheja.addepally@intel.com>2015-09-23 07:19:02 +0000
committerRavitheja Addepally <ravitheja.addepally@intel.com>2015-09-23 07:19:02 +0000
commit9fcf72ef9bdc047a7ab24d0fc00604cddbd5ddf5 (patch)
treeeecb4acac1c4095165b1faa35558496751a3c99b /lldb/source/Core/Module.cpp
parent77b94d4416cb24ea70693dfed7f8e54901ab9854 (diff)
downloadbcm5719-llvm-9fcf72ef9bdc047a7ab24d0fc00604cddbd5ddf5.tar.gz
bcm5719-llvm-9fcf72ef9bdc047a7ab24d0fc00604cddbd5ddf5.zip
Testcase and fix for bug 24074
Summary: In bug 24074, the type information is not shown correctly. This commit includes the following - -> Changes for displaying correct type based on current lexical scope for the command "image lookup -t" -> The corresponding testcase. Reviewers: jingham, ovyalov, spyffe, richard.mitton, clayborg Differential Revision: http://reviews.llvm.org/D12404 llvm-svn: 248366
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 8f6a4a10ac2..63bbba9afdb 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -36,6 +36,7 @@
#include "lldb/Target/Target.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
+#include "lldb/Symbol/TypeMap.h"
#include "Plugins/ObjectFile/JIT/ObjectFileJIT.h"
@@ -940,7 +941,7 @@ Module::FindTypes_Impl (const SymbolContext& sc,
const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
- TypeList& types)
+ TypeMap& types)
{
Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
if (sc.module_sp.get() == NULL || sc.module_sp.get() == this)
@@ -960,7 +961,11 @@ Module::FindTypesInNamespace (const SymbolContext& sc,
TypeList& type_list)
{
const bool append = true;
- return FindTypes_Impl(sc, type_name, parent_decl_ctx, append, max_matches, type_list);
+ TypeMap types_map;
+ size_t num_types = FindTypes_Impl(sc, type_name, parent_decl_ctx, append, max_matches, types_map);
+ if (num_types > 0)
+ sc.SortTypeList(types_map, type_list);
+ return num_types;
}
lldb::TypeSP
@@ -989,6 +994,7 @@ Module::FindTypes (const SymbolContext& sc,
std::string type_basename;
const bool append = true;
TypeClass type_class = eTypeClassAny;
+ TypeMap typesmap;
if (Type::GetTypeScopeAndBasename (type_name_cstr, type_scope, type_basename, type_class))
{
// Check if "name" starts with "::" which means the qualified type starts
@@ -1002,10 +1008,10 @@ Module::FindTypes (const SymbolContext& sc,
exact_match = true;
}
ConstString type_basename_const_str (type_basename.c_str());
- if (FindTypes_Impl(sc, type_basename_const_str, NULL, append, max_matches, types))
+ if (FindTypes_Impl(sc, type_basename_const_str, NULL, append, max_matches, typesmap))
{
- types.RemoveMismatchedTypes (type_scope, type_basename, type_class, exact_match);
- num_matches = types.GetSize();
+ typesmap.RemoveMismatchedTypes (type_scope, type_basename, type_class, exact_match);
+ num_matches = typesmap.GetSize();
}
}
else
@@ -1015,18 +1021,18 @@ Module::FindTypes (const SymbolContext& sc,
{
// The "type_name_cstr" will have been modified if we have a valid type class
// prefix (like "struct", "class", "union", "typedef" etc).
- FindTypes_Impl(sc, ConstString(type_name_cstr), NULL, append, max_matches, types);
- types.RemoveMismatchedTypes (type_class);
- num_matches = types.GetSize();
+ FindTypes_Impl(sc, ConstString(type_name_cstr), NULL, append, max_matches, typesmap);
+ typesmap.RemoveMismatchedTypes (type_class);
+ num_matches = typesmap.GetSize();
}
else
{
- num_matches = FindTypes_Impl(sc, name, NULL, append, max_matches, types);
+ num_matches = FindTypes_Impl(sc, name, NULL, append, max_matches, typesmap);
}
}
-
+ if (num_matches > 0)
+ sc.SortTypeList(typesmap, types);
return num_matches;
-
}
SymbolVendor*
OpenPOWER on IntegriCloud