summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp')
-rw-r--r--llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index a4dfc2e2392..950349377bf 100644
--- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -82,6 +82,10 @@ static cl::opt<bool>
ClPrettyPrint("pretty-print", cl::init(false),
cl::desc("Make the output more human friendly"));
+static cl::opt<int> ClPrintSourceContextLines(
+ "print-source-context-lines", cl::init(0),
+ cl::desc("Print N number of source file context"));
+
static bool error(std::error_code ec) {
if (!ec)
return false;
@@ -155,7 +159,7 @@ int main(int argc, char **argv) {
LLVMSymbolizer Symbolizer(Opts);
DIPrinter Printer(outs(), ClPrintFunctions != FunctionNameKind::None,
- ClPrettyPrint);
+ ClPrettyPrint, ClPrintSourceContextLines);
const int kMaxInputStringLength = 1024;
char InputString[kMaxInputStringLength];
OpenPOWER on IntegriCloud