[llvm] r286150 - [lit] Print negative exit codes on Windows in hex

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 13:36:30 PST 2016


Yeah, I'm debugging WinASan test failures, which have a lot of interesting
exit codes. :(

On Mon, Nov 7, 2016 at 1:17 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Mon, Nov 7, 2016 at 4:06 PM, Reid Kleckner via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: rnk
> > Date: Mon Nov  7 15:06:20 2016
> > New Revision: 286150
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=286150&view=rev
> > Log:
> > [lit] Print negative exit codes on Windows in hex
> >
> > Negative exit codes are usually exceptions. They're easier to recognize
> > in hex. Compare -1073741502 to 0xc0000142.
>
> Thank you for this! That is going to save a bit of time now and again. :-)
>
> ~Aaron
>
> >
> > Modified:
> >     llvm/trunk/utils/lit/lit/TestRunner.py
> >
> > Modified: llvm/trunk/utils/lit/lit/TestRunner.py
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/
> lit/TestRunner.py?rev=286150&r1=286149&r2=286150&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/lit/lit/TestRunner.py (original)
> > +++ llvm/trunk/utils/lit/lit/TestRunner.py Mon Nov  7 15:06:20 2016
> > @@ -555,8 +555,14 @@ def executeScriptInternal(test, litConfi
> >
> >          # Show the error conditions:
> >          if result.exitCode != 0:
> > -            out += "error: command failed with exit status: %d\n" % (
> > -                result.exitCode,)
> > +            # On Windows, a negative exit code indicates a signal, and
> those are
> > +            # easier to recognize or look up if we print them in hex.
> > +            if litConfig.isWindows and result.exitCode < 0:
> > +                codeStr = hex(int(result.exitCode &
> 0xFFFFFFFF)).rstrip("L")
> > +            else:
> > +                codeStr = str(result.exitCode)
> > +            out += "error: command failed with exit status: %s\n" % (
> > +                codeStr,)
> >          if litConfig.maxIndividualTestTime > 0:
> >              out += 'error: command reached timeout: %s\n' % (
> >                  str(result.timeoutReached),)
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161107/010385c6/attachment.html>


More information about the llvm-commits mailing list