[symbolizer] Treat invalid address as addr2line does
authorSerge Pavlov <sepavloff@gmail.com>
Tue, 28 Mar 2023 17:44:55 +0000 (00:44 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 29 Mar 2023 15:28:48 +0000 (22:28 +0700)
commit27c4777f41d2ab204c1cf84ff1cccd5ba41354da
treef06bf00338141bbaeffdde88d1fcc44b35ee528d
parent0e2ed90516ee834ca78f4974a7aebcba1a302eb0
[symbolizer] Treat invalid address as addr2line does

llvm-symbolizer echoed input if it was not recognized as a valid address.
This behavior was extended to llvm-addr2line as well. GNU addr2line in
this case optputs "??:0". This difference prevents implementation of
symbol+offset lookup available in the recent versions of GNU binutils.
In that case a string that is not an address may be a symbol.

This change make reaction of llvm-addr2line on unrecognized input closer
to GNU addr2line.
llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
llvm/test/tools/llvm-symbolizer/flush-output.s
llvm/test/tools/llvm-symbolizer/input-base.test
llvm/test/tools/llvm-symbolizer/invalid-input-address.test
llvm/test/tools/llvm-symbolizer/options-from-env.test
llvm/test/tools/llvm-symbolizer/output-style-empty-line.test
llvm/test/tools/llvm-symbolizer/sym.test