[PATCH] [llvm-symbolizer] Introduce the -dsym-hint option.

Alexander Potapenko glider at google.com
Fri Oct 10 07:31:14 PDT 2014

Comment at: LLVMSymbolize.cpp:215
@@ -213,1 +214,3 @@
+// /path/to/foo.dSYM/Contents/Resources/DWARF/foo.
 static std::string getDarwinDWARFResourceForPath(const std::string &Path) {
+  SmallString<16> DsymDirectory;
glider wrote:
> samsonov wrote:
> > Why all this complexity? Can you just change this function to take .dSYM bundle, and call it either on file from .dSYM hints argument, or from PathToExe + ".dSYM"?
> We probably don't want to try those paths from -dsym-hints that don't end with ".dSYM"
Hmm, the following workflow still doesn't work:
  $ clang foo.c -g -c && clang foo.o -g -o foo
  $ dsymutil foo -o bar.dSYM

Turns out the DWARF binary for foo is at bar.dSYM/Contents/Resources/DWARF/foo.

Comment at: LLVMSymbolize.cpp:329
@@ +328,3 @@
+void LLVMSymbolizer::populateDsymPaths(std::vector<std::string> &Paths, const std::string &ExePath) {
+  const std::string &ResourcePath =
glider wrote:
> samsonov wrote:
> > This can be a static helper, pass Opts.DynamicHints here.
> > Output parameters ("Paths") should better go last in argument list.
> Agreed.
Actually, no. This function needs Opts.DsymHints.


More information about the llvm-commits mailing list