[symbolizer] Change error message if module not found (recommit)
authorSerge Pavlov <sepavloff@gmail.com>
Sun, 23 Apr 2023 06:35:35 +0000 (06:35 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Sun, 23 Apr 2023 06:35:35 +0000 (06:35 +0000)
commit1d5fa4f88f636f99f55933c919789662518cb951
tree58c0040eb64bcc40c49e27feb0ddbe2c7ae454a9
parenta8aa43bb1a7c5c7c1bfd59a64a8ffbb6550b6a7e
[symbolizer] Change error message if module not found (recommit)

This is a recommit of 75f1f158812d, reverted in 7a443b1c493d, because
it caused compilation error in
compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp.
The error was fixed by Kasimir Georgiev in de4c038c7ba2, but this
commit was reverted in de088dd3a0aa, because the initial commit was
reverted.

This commit reverts both the reverting commits, 7a443b1c493d and
de088dd3a0aa.

Original commit message is below.

If llvm-symbolize did not find module, the error looked like:

    LLVMSymbolizer: error reading file: No such file or directory

This message does not follow common practice: LLVMSymbolizer is not an
utility name. Also the message did not not contain the name of missed file.

With this change the error message looks differently:

    llvm-symbolizer: error: 'abc': No such file or directory

This format is closer to messages produced by other utilities and allow
proper coloring.

Differential Revision: https://reviews.llvm.org/D148032
compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
llvm/test/DebugInfo/Symbolize/ELF/symtab-file2.yaml
llvm/test/DebugInfo/symbolize-missing-file.test
llvm/test/tools/llvm-symbolizer/debuginfod-missing-build-id.test
llvm/test/tools/llvm-symbolizer/output-style-inlined.test
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp