[lldb][FreeBSD] Fix crash when execve fails with asserts enabled
535da108 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.
parent
60d7bf3d
Please register or sign in to comment