[PATCH] [compiler-rt] Add AtosSymbolizer and DlAddrSymbolizer as fallbacks for OS X

Alexey Samsonov vonosmas at gmail.com
Thu Mar 12 15:44:56 PDT 2015


The logic here is very convoluted. First of all, I don't like that you ripped parts of ChooseMainSymbolizerTools out of this function, and it now doesn't do what it says. Let's keep all this logic contained. Now, more questions:

1. would you need to fallback to DlAddrSymbolizer if internal/libbacktrace is available (I know that for now they are not available on Mac, but still). I don't think so.
2. do you need to fallback to atos if the user *explicitly* specified llvm-symbolizer in ASAN_SYMBOLIZER_PATH?
3. do you need to fallback to atos if llvm-symbolizer was detected by FindPathToBinary call?

That is, I'd first like to figure out if there's a case when we need more than one out-of-process symbolizer. If not, we can restructure the code like this (pseudocode):

  if (path_to_external && path_to_external[0] == '\0') { /* add nothing */ }
  else if (EndsWith(path_to_external, "llvm-symbolizer(.exe)?") { /* use llvm-symbolizer */ }
  else if (EndsWith(path_to_external, "atos")) { /* use atos */ }
  else if (EndsWith(path_to_external, "addr2line")) { /* use addr2line */ }
  else {
    assert(path_to_external == nullptr);  // Otherwise symbolizer program is unknown
    /* choose which one of llvm-symbolizer, atos, or addr2line is available and use it */
  }

You can move *this* piece (figuring out external symbolizer to use) in a separate function.


http://reviews.llvm.org/D8285

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list