[PATCH] D148032: [symbolizer] Change error message if module not found

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 10:24:34 PDT 2023


sepavloff added a comment.

This is attempt to implement item 3 described in https://reviews.llvm.org/D147652#4257424.

In D147652#4257424 <https://reviews.llvm.org/D147652#4257424>, @jhenderson wrote:

> It seems to me like there are 4(?) different issues that have come up here, and they probably need splitting into separate patches, and possibly even an RFC or two. I think the separate issues are:
> ...
>
> 3. Re. error message format, I don't think an exact match of error message format should be necessary. That being said, I do think we should broadly match the error style emitted by our other binutils replacements (and certainly messages from the same tool should be formatted the same way). This goes for both llvm-symbolizer and llvm-addr2line. For example, if the input file is missing for llvm-nm, the following error is emitted on my Windows machine: "D:\llvm\build\Debug\bin\llvm-nm.exe: error: missing.bin: no such file or directory". The "error" is in red. Given we already deviate (slightly) from the GNU tools in the exact message format (GNU tools, apart from readelf, don't print the "error:" part), I think normalising with the rest of our tools makes more sense. Where there's a clear message from the OS, we should print that (along with any appropriate additional context). Where there isn't (e.g. you report an error on a missing file, without having attempted to actually open that file), it doesn't hurt to match the GNU message content, if the GNU one is sensible.

Strict reproduction of `addr2line` messages is not a goal, the patch only tries making output slightly more convenient and looking similar to other utilities.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148032/new/

https://reviews.llvm.org/D148032



More information about the llvm-commits mailing list