Index: lldb/test/API/functionalities/exec/main.cpp =================================================================== --- lldb/test/API/functionalities/exec/main.cpp +++ lldb/test/API/functionalities/exec/main.cpp @@ -7,12 +7,15 @@ #include #include +extern char **environ; + int main(int argc, char const **argv) { char *buf = strdup(argv[0]); // Set breakpoint 1 here std::string directory_name(::dirname(buf)); std::string other_program = directory_name + "/secondprog"; - execve(other_program.c_str(), const_cast(argv), nullptr); + argv[0] = other_program.c_str(); + execve(argv[0], const_cast(argv), environ); perror("execve"); abort(); }