Currently there is no way to disable source file output from llvm-symbolizer. Similarly there's no way to disable symbolicating inlined functions with llvm-symbolzer (this option is automatically disabled when llvm-addr2line is invoked instead of llvm-symbolizer).
This diff introduces flags to further customize llvm-symbolizer's output to support these two usecases:
- --no-inlining: This disables symbolicating inlined frames. When paired with --output-style=LLVM and --use-symbol-table this results in a list of functions that appear in the final binary
- --no-source-file: This disables printing source file information when symbolicating an address
- --source-file: This enables printing source file information (the default). This option was added to balance --no-source-file.
The last of --no-source-file and --source-file passed will determine whether source file information is printed or not. The behavior of llvm-symbolizer before this diff should be identical to the behavior after this diff when none of the new options are specified.
Together --functions=linkage --demangle --output-style=LLVM --no-source-file --no-inlining results in a list of symbol names which appear in the resulting binary. This is useful when symbolicating a list of addresses e.g. for link order files.
N.B. The same data can be extracted with a processor on top of --functions=linkage --demangle --output-style=LLVM, however with large lists of symbols I've found that this takes quite a long time (my processor(s) were in perl/python- in theory I could've written a C/++ one, but I figure best just add these as formatting options to llvm-symbolizer instead).