summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2014-10-17 00:50:19 +0000
committerAlexander Potapenko <glider@google.com>2014-10-17 00:50:19 +0000
commit7aaf5140929b00a2acc9d2619c806860f1a148d8 (patch)
tree305e488af9552880cd67a50c3ab7611801447e66 /llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
parented1d075d7877232223e6954d402b3f1ba228687d (diff)
downloadbcm5719-llvm-7aaf5140929b00a2acc9d2619c806860f1a148d8.tar.gz
bcm5719-llvm-7aaf5140929b00a2acc9d2619c806860f1a148d8.zip
[llvm-symbolizer] Introduce the -dsym-hint option.
llvm-symbolizer will consult one of the .dSYM paths passed via -dsym-hint if it fails to find the .dSYM bundle at the default location. llvm-svn: 220004
Diffstat (limited to 'llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp')
-rw-r--r--llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index 29db172531b..d554022e450 100644
--- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -19,6 +19,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
@@ -61,6 +62,11 @@ ClBinaryName("obj", cl::init(""),
cl::desc("Path to object file to be symbolized (if not provided, "
"object file should be specified for each input line)"));
+static cl::list<std::string>
+ClDsymHint("dsym-hint", cl::ZeroOrMore,
+ cl::desc("Path to .dSYM bundles to search for debug info for the "
+ "object files"));
+
static bool parseCommand(bool &IsData, std::string &ModuleName,
uint64_t &ModuleOffset) {
const char *kDataCmd = "DATA ";
@@ -119,6 +125,14 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm-symbolizer\n");
LLVMSymbolizer::Options Opts(ClUseSymbolTable, ClPrintFunctions,
ClPrintInlining, ClDemangle, ClDefaultArch);
+ for (const auto &hint : ClDsymHint) {
+ if (sys::path::extension(hint) == ".dSYM") {
+ Opts.DsymHints.push_back(hint);
+ } else {
+ errs() << "Warning: invalid dSYM hint: \"" << hint <<
+ "\" (must have the '.dSYM' extension).\n";
+ }
+ }
LLVMSymbolizer Symbolizer(Opts);
bool IsData = false;
OpenPOWER on IntegriCloud