summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-test/lldb-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/lldb-test/lldb-test.cpp')
-rw-r--r--lldb/tools/lldb-test/lldb-test.cpp52
1 files changed, 25 insertions, 27 deletions
diff --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp
index d44b6fdc2db..e522f946712 100644
--- a/lldb/tools/lldb-test/lldb-test.cpp
+++ b/lldb/tools/lldb-test/lldb-test.cpp
@@ -22,8 +22,9 @@
#include "lldb/Symbol/ClangASTImporter.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
@@ -168,7 +169,7 @@ static cl::opt<std::string> File("file",
static cl::opt<int> Line("line", cl::desc("Line to search."),
cl::sub(SymbolsSubcommand));
-static Expected<CompilerDeclContext> getDeclContext(SymbolVendor &Vendor);
+static Expected<CompilerDeclContext> getDeclContext(SymbolFile &Symfile);
static Error findFunctions(lldb_private::Module &Module);
static Error findBlocks(lldb_private::Module &Module);
@@ -335,11 +336,11 @@ int opts::breakpoint::evaluateBreakpoints(Debugger &Dbg) {
}
Expected<CompilerDeclContext>
-opts::symbols::getDeclContext(SymbolVendor &Vendor) {
+opts::symbols::getDeclContext(SymbolFile &Symfile) {
if (Context.empty())
return CompilerDeclContext();
VariableList List;
- Vendor.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
if (List.Empty())
return make_string_error("Context search didn't find a match.");
if (List.GetSize() > 1)
@@ -348,7 +349,7 @@ opts::symbols::getDeclContext(SymbolVendor &Vendor) {
}
Error opts::symbols::findFunctions(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ SymbolFile &Symfile = *Module.GetSymbolFile();
SymbolContextList List;
if (!File.empty()) {
assert(Line != 0);
@@ -380,15 +381,15 @@ Error opts::symbols::findFunctions(lldb_private::Module &Module) {
} else if (Regex) {
RegularExpression RE(Name);
assert(RE.IsValid());
- Vendor.FindFunctions(RE, true, false, List);
+ Symfile.FindFunctions(RE, true, false, List);
} else {
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
- Vendor.FindFunctions(ConstString(Name), ContextPtr, getFunctionNameFlags(),
+ Symfile.FindFunctions(ConstString(Name), ContextPtr, getFunctionNameFlags(),
true, false, List);
}
outs() << formatv("Found {0} functions:\n", List.GetSize());
@@ -436,15 +437,15 @@ Error opts::symbols::findBlocks(lldb_private::Module &Module) {
}
Error opts::symbols::findNamespaces(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ SymbolFile &Symfile = *Module.GetSymbolFile();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
CompilerDeclContext Result =
- Vendor.FindNamespace(ConstString(Name), ContextPtr);
+ Symfile.FindNamespace(ConstString(Name), ContextPtr);
if (Result)
outs() << "Found namespace: "
<< Result.GetScopeQualifiedName().GetStringRef() << "\n";
@@ -454,8 +455,8 @@ Error opts::symbols::findNamespaces(lldb_private::Module &Module) {
}
Error opts::symbols::findTypes(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ SymbolFile &Symfile = *Module.GetSymbolFile();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
@@ -463,7 +464,7 @@ Error opts::symbols::findTypes(lldb_private::Module &Module) {
DenseSet<SymbolFile *> SearchedFiles;
TypeMap Map;
- Vendor.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
+ Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
SearchedFiles, Map);
outs() << formatv("Found {0} types:\n", Map.GetSize());
@@ -474,12 +475,12 @@ Error opts::symbols::findTypes(lldb_private::Module &Module) {
}
Error opts::symbols::findVariables(lldb_private::Module &Module) {
- SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ SymbolFile &Symfile = *Module.GetSymbolFile();
VariableList List;
if (Regex) {
RegularExpression RE(Name);
assert(RE.IsValid());
- Vendor.FindGlobalVariables(RE, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(RE, UINT32_MAX, List);
} else if (!File.empty()) {
CompUnitSP CU;
for (size_t Ind = 0; !CU && Ind < Module.GetNumCompileUnits(); ++Ind) {
@@ -497,13 +498,13 @@ Error opts::symbols::findVariables(lldb_private::Module &Module) {
List.AddVariables(CU->GetVariableList(true).get());
} else {
- Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)
return ContextOr.takeError();
CompilerDeclContext *ContextPtr =
ContextOr->IsValid() ? &*ContextOr : nullptr;
- Vendor.FindGlobalVariables(ConstString(Name), ContextPtr, UINT32_MAX, List);
+ Symfile.FindGlobalVariables(ConstString(Name), ContextPtr, UINT32_MAX, List);
}
outs() << formatv("Found {0} variables:\n", List.GetSize());
StreamString Stream;
@@ -521,10 +522,9 @@ Error opts::symbols::dumpModule(lldb_private::Module &Module) {
}
Error opts::symbols::dumpAST(lldb_private::Module &Module) {
- SymbolVendor &plugin = *Module.GetSymbolVendor();
- Module.ParseAllDebugSymbols();
+ Module.ParseAllDebugSymbols();
- auto symfile = plugin.GetSymbolFile();
+ auto symfile = Module.GetSymbolFile();
if (!symfile)
return make_string_error("Module has no symbol file.");
@@ -552,9 +552,7 @@ Error opts::symbols::dumpAST(lldb_private::Module &Module) {
}
Error opts::symbols::verify(lldb_private::Module &Module) {
- SymbolVendor &plugin = *Module.GetSymbolVendor();
-
- SymbolFile *symfile = plugin.GetSymbolFile();
+ SymbolFile *symfile = Module.GetSymbolFile();
if (!symfile)
return make_string_error("Module has no symbol file.");
@@ -707,8 +705,8 @@ int opts::symbols::dumpSymbols(Debugger &Dbg) {
Spec.GetSymbolFileSpec().SetFile(Symbols, FileSpec::Style::native);
auto ModulePtr = std::make_shared<lldb_private::Module>(Spec);
- SymbolVendor *Vendor = ModulePtr->GetSymbolVendor();
- if (!Vendor) {
+ SymbolFile *Symfile = ModulePtr->GetSymbolFile();
+ if (!Symfile) {
WithColor::error() << "Module has no symbol vendor.\n";
return 1;
}
@@ -774,7 +772,7 @@ static int dumpObjectFiles(Debugger &Dbg) {
// Fetch symbol vendor before we get the section list to give the symbol
// vendor a chance to populate it.
- ModulePtr->GetSymbolVendor();
+ ModulePtr->GetSymbolFile();
SectionList *Sections = ModulePtr->GetSectionList();
if (!Sections) {
llvm::errs() << "Could not load sections for module " << File << "\n";
OpenPOWER on IntegriCloud