summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 20:26:41 +0000
committerdim <dim@FreeBSD.org>2015-05-27 20:26:41 +0000
commit5ef8fd3549d38e883a31881636be3dc2a275de20 (patch)
treebd13a22d9db57ccf3eddbc07b32c18109521d050 /contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
parent77794ebe2d5718eb502c93ec32f8ccae4d8a0b7b (diff)
parent782067d0278612ee75d024b9b135c221c327e9e8 (diff)
downloadFreeBSD-src-5ef8fd3549d38e883a31881636be3dc2a275de20.zip
FreeBSD-src-5ef8fd3549d38e883a31881636be3dc2a275de20.tar.gz
Merge llvm trunk r238337 from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
Diffstat (limited to 'contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp')
-rw-r--r--contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index d554022..9c9f3ad 100644
--- a/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -17,10 +17,12 @@
#include "LLVMSymbolize.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/COM.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
@@ -47,8 +49,13 @@ static cl::opt<FunctionNameKind> ClPrintFunctions(
clEnumValEnd));
static cl::opt<bool>
-ClPrintInlining("inlining", cl::init(true),
- cl::desc("Print all inlined frames for a given address"));
+ ClUseRelativeAddress("relative-address", cl::init(false),
+ cl::desc("Interpret addresses as relative addresses"),
+ cl::ReallyHidden);
+
+static cl::opt<bool>
+ ClPrintInlining("inlining", cl::init(true),
+ cl::desc("Print all inlined frames for a given address"));
static cl::opt<bool>
ClDemangle("demangle", cl::init(true), cl::desc("Demangle function names"));
@@ -122,9 +129,12 @@ int main(int argc, char **argv) {
PrettyStackTraceProgram X(argc, argv);
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
+ llvm::sys::InitializeCOMRAII COM(llvm::sys::COMThreadingMode::MultiThreaded);
+
cl::ParseCommandLineOptions(argc, argv, "llvm-symbolizer\n");
- LLVMSymbolizer::Options Opts(ClUseSymbolTable, ClPrintFunctions,
- ClPrintInlining, ClDemangle, ClDefaultArch);
+ LLVMSymbolizer::Options Opts(ClPrintFunctions, ClUseSymbolTable,
+ ClPrintInlining, ClDemangle,
+ ClUseRelativeAddress, ClDefaultArch);
for (const auto &hint : ClDsymHint) {
if (sys::path::extension(hint) == ".dSYM") {
Opts.DsymHints.push_back(hint);
@@ -145,5 +155,6 @@ int main(int argc, char **argv) {
outs() << Result << "\n";
outs().flush();
}
+
return 0;
}
OpenPOWER on IntegriCloud