summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-03-08 21:42:24 +0000
committerZachary Turner <zturner@google.com>2016-03-08 21:42:24 +0000
commita99000dd311b972e35f889c61bbdbc22a1680abd (patch)
tree3dd5f55d15378b19e533c626075341f8c680e5ce /llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
parent8d950ce18c6d8ab3b43a4950cecbb17a83914910 (diff)
downloadbcm5719-llvm-a99000dd311b972e35f889c61bbdbc22a1680abd.tar.gz
bcm5719-llvm-a99000dd311b972e35f889c61bbdbc22a1680abd.zip
[llvm-pdbdump] Dump line table information.
This patch adds the -lines command line option which will dump source/line information for each compiland and source file. llvm-svn: 262962
Diffstat (limited to 'llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
index 8dd0c49d1c4..940ef1b6399 100644
--- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -76,6 +76,7 @@ cl::opt<bool> Globals("globals", cl::desc("Dump global symbols"),
cl::opt<bool> Externals("externals", cl::desc("Dump external symbols"),
cl::cat(TypeCategory));
cl::opt<bool> Types("types", cl::desc("Display types"), cl::cat(TypeCategory));
+cl::opt<bool> Lines("lines", cl::desc("Line tables"), cl::cat(TypeCategory));
cl::opt<bool>
All("all", cl::desc("Implies all other options in 'Symbol Types' category"),
cl::cat(TypeCategory));
@@ -684,8 +685,11 @@ static void dumpInput(StringRef Path) {
Printer.Indent();
auto Compilands = GlobalScope->findAllChildren<PDBSymbolCompiland>();
CompilandDumper Dumper(Printer);
+ CompilandDumpFlags options = CompilandDumper::Flags::None;
+ if (opts::Lines)
+ options = options | CompilandDumper::Flags::Lines;
while (auto Compiland = Compilands->getNext())
- Dumper.start(*Compiland, false);
+ Dumper.start(*Compiland, options);
Printer.Unindent();
}
@@ -742,6 +746,9 @@ static void dumpInput(StringRef Path) {
ExternalSymbolDumper Dumper(Printer);
Dumper.start(*GlobalScope);
}
+ if (opts::Lines) {
+ Printer.NewLine();
+ }
outs().flush();
}
@@ -762,20 +769,32 @@ int main(int argc_, const char *argv_[]) {
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argv.size(), argv.data(), "LLVM PDB Dumper\n");
+ if (opts::Lines)
+ opts::Compilands = true;
+
if (opts::All) {
opts::Compilands = true;
opts::Symbols = true;
opts::Globals = true;
opts::Types = true;
opts::Externals = true;
+ opts::Lines = true;
}
+
+ // When adding filters for excluded compilands and types, we need to remember
+ // that these are regexes. So special characters such as * and \ need to be
+ // escaped in the regex. In the case of a literal \, this means it needs to
+ // be escaped again in the C++. So matching a single \ in the input requires
+ // 4 \es in the C++.
if (opts::ExcludeCompilerGenerated) {
opts::ExcludeTypes.push_back("__vc_attributes");
- opts::ExcludeCompilands.push_back("* Linker *");
+ opts::ExcludeCompilands.push_back("\\* Linker \\*");
}
if (opts::ExcludeSystemLibraries) {
opts::ExcludeCompilands.push_back(
- "f:\\binaries\\Intermediate\\vctools\\crt_bld");
+ "f:\\\\binaries\\\\Intermediate\\\\vctools\\\\crt_bld");
+ opts::ExcludeCompilands.push_back("f:\\\\dd\\\\vctools\\\\crt");
+ opts::ExcludeCompilands.push_back("d:\\\\th.obj.x86fre\\\\minkernel");
}
#if defined(HAVE_DIA_SDK)
OpenPOWER on IntegriCloud