aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2024-03-08 16:54:01 +0000
committerDavid Spickett <david.spickett@linaro.org>2024-03-08 17:15:11 +0000
commit73b2d672c1c8318cd16a02812c39ae3997b9dbcd (patch)
tree9e7d7e3543e0e366f9bb82c424d8852f932a8b86 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent60d7bf3dbe6c32ed67ed65cb15727cddd9531979 (diff)
downloadllvm-73b2d672c1c8318cd16a02812c39ae3997b9dbcd.zip
llvm-73b2d672c1c8318cd16a02812c39ae3997b9dbcd.tar.gz
llvm-73b2d672c1c8318cd16a02812c39ae3997b9dbcd.tar.bz2
[lldb][FreeBSD] Fix crash when execve fails with asserts enabled
535da10842c7309e9eeaf9828cf6bb034fecaf16 introduced a check, when execve fails, to see if we are allowed to trace programs at all. Unfortunately because we like to call Status vars "error" and "status" in various combinations, one got misnamed. This lead to lldb-server trying to make an error value out of a success value when you did the following: ``` $ ./bin/lldb-server gdbserver 127.0.0.1:1234 -- is_not_a_file Assertion failed: (Err && "Cannot create Expected<T> from Error success value."), function Expected... ``` This happened because the execve fails, but the check whether we can trace says yes we can trace, but then we use the Status from the check to create the return value. That Status is in fact a success value not the failed Status we got from the execve attempt. With the name corrected you now get: ``` $ ./bin/lldb-server gdbserver 127.0.0.1:1234 -- is_not_a_file error: failed to launch 'is_not_a_file': execve failed: No such file or directory ``` Which is what we expect to see. This also fixes the test `TestGDBRemoteLaunch.py` when asserts are enabled.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions