llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.29k stars 12.11k forks source link

Confusing error message for unknown argument #48224

Closed jh7370 closed 3 years ago

jh7370 commented 3 years ago
Bugzilla Link 48880
Resolution FIXED
Resolved on Aug 31, 2021 09:14
Version trunk
OS Windows NT
CC @gbreynoo

Extended Description

Recently, llvm-symbolizer stopped supporting -i=0 as an option for disabling the -i option (which is enabled by default), in favour of a different option. I forgot about this temporarily, and tried to use the old-style option, and got the following result:

PS C:\Work\TempWork> C:\llvm\build\Debug\bin\llvm-symbolizer.exe --obj=foo.elf 0x100 -i=0 error: unknown argument '-=0'

Note the lack of the "i" in the output. My suspicion is that because -i is a groupable option, it is removed from the list of unknown characters (because it is recognised) and the rest are reported. However, the error message is somewhat confusing, especially for people who might not be aware of the behaviour change.

Some more interesting examples show that it is all characters after the first unknown character that gets reported:

PS C:\Work\TempWork> C:\llvm\build\Debug\bin\llvm-symbolizer.exe --obj=foo.elf 0x100 -ix=0 error: unknown argument '-x=0' PS C:\Work\TempWork> C:\llvm\build\Debug\bin\llvm-symbolizer.exe --obj=foo.elf 0x100 -ixf=0 error: unknown argument '-xf=0' PS C:\Work\TempWork> C:\llvm\build\Debug\bin\llvm-symbolizer.exe --obj=foo.elf 0x100 -ifx=0 error: unknown argument '-x=0'

We should fix this (it's likely an issue in the command-line library).

gbreynoo commented 3 years ago

Fixed in commit 71d7fed3bc2ad6c22729d446526a59fcfd99bd03