[llvm-bugs] [Bug 48880] New: Confusing error message for unknown argument

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 26 03:08:18 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48880

            Bug ID: 48880
           Summary: Confusing error message for unknown argument
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-symbolizer
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: llvm-bugs at lists.llvm.org

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).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210126/d96722cd/attachment.html>


More information about the llvm-bugs mailing list