[llvm-bugs] [Bug 42970] New: Tidy up llvm-size's error messages

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 12 08:07:34 PDT 2019


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

            Bug ID: 42970
           Summary: Tidy up llvm-size's error messages
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-objcopy/strip
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: alexander.v.shaposhnikov at gmail.com,
                    jake.h.ehrlich at gmail.com,
                    jh7370.2008 at my.bristol.ac.uk,
                    llvm-bugs at lists.llvm.org, rupprecht at google.com

A number of llvm-size's error messages leave a bit to be desired. For example,
if you feed it an unrecognized binary, you get:

c:\llvm\build\debug\bin\llvm-size.exe:
C:\llvm\llvm\test\tools\llvm-size\invalid-input.test The file was not
recognized as a valid object file

If the input file does not exist:

C:\llvm\build\Debug\bin\llvm-size.exe: blah.a no such file or directory

Note that in both these cases, the file name is neither quoted nor separated
from the error message body in any way, which makes the error message hard to
read:

C:\llvm\build\Debug\bin\llvm-size.exe: this file does not exist no such file or
directory

On a related note, llvm-size has a small block of code that looks to be
reporting an error message for an unrecognized file:

    errs() << ToolName << ": " << file << ": "
           << "Unrecognized file type.\n";

However, in the first example above, it does not match the error message that
comes out for this case. Probably better would be to say "unsupported file
type" (an unrecognised one is one that the createBinary method doesn't know
about, whilst an unsupported one is one it does know about, but llvm-size
doesn't understand, e.g. minidumps).

-- 
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/20190812/6c350b67/attachment-0001.html>


More information about the llvm-bugs mailing list