summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h7
-rw-r--r--llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp12
-rw-r--r--llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp5
3 files changed, 19 insertions, 5 deletions
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
index 49f86eae01c..ab82be3706d 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
@@ -29,15 +29,18 @@ class DIPrinter {
bool PrintFunctionNames;
bool PrintPretty;
int PrintSourceContext;
+ bool Verbose;
void print(const DILineInfo &Info, bool Inlined);
void printContext(const std::string &FileName, int64_t Line);
public:
DIPrinter(raw_ostream &OS, bool PrintFunctionNames = true,
- bool PrintPretty = false, int PrintSourceContext = 0)
+ bool PrintPretty = false, int PrintSourceContext = 0,
+ bool Verbose = false)
: OS(OS), PrintFunctionNames(PrintFunctionNames),
- PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext) {}
+ PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext),
+ Verbose(Verbose) {}
DIPrinter &operator<<(const DILineInfo &Info);
DIPrinter &operator<<(const DIInliningInfo &Info);
diff --git a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
index be5c603a38e..aae009ecb16 100644
--- a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
@@ -78,8 +78,16 @@ void DIPrinter::print(const DILineInfo &Info, bool Inlined) {
std::string Filename = Info.FileName;
if (Filename == kDILineInfoBadString)
Filename = kBadString;
- OS << Filename << ":" << Info.Line << ":" << Info.Column << "\n";
- printContext(Filename, Info.Line);
+ if (!Verbose) {
+ OS << Filename << ":" << Info.Line << ":" << Info.Column << "\n";
+ printContext(Filename, Info.Line);
+ return;
+ }
+ OS << " Filename: " << Filename << "\n";
+ OS << " Line: " << Info.Line << "\n";
+ OS << " Column: " << Info.Column << "\n";
+ if (Info.Discriminator)
+ OS << " Discriminator: " << Info.Discriminator << "\n";
}
DIPrinter &DIPrinter::operator<<(const DILineInfo &Info) {
diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index fc37dea4c48..c9e0cc2b3b0 100644
--- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -85,6 +85,9 @@ static cl::opt<int> ClPrintSourceContextLines(
"print-source-context-lines", cl::init(0),
cl::desc("Print N number of source file context"));
+static cl::opt<bool> ClVerbose("verbose", cl::init(false),
+ cl::desc("Print verbose line info"));
+
template<typename T>
static bool error(Expected<T> &ResOrErr) {
if (ResOrErr)
@@ -160,7 +163,7 @@ int main(int argc, char **argv) {
LLVMSymbolizer Symbolizer(Opts);
DIPrinter Printer(outs(), ClPrintFunctions != FunctionNameKind::None,
- ClPrettyPrint, ClPrintSourceContextLines);
+ ClPrettyPrint, ClPrintSourceContextLines, ClVerbose);
const int kMaxInputStringLength = 1024;
char InputString[kMaxInputStringLength];
OpenPOWER on IntegriCloud