Author: Jonas Devlieghere
Date: 2021-02-15T18:42:21-08:00
New Revision: 71811048c0061c2ecf9aa6ce14c41f3f6ecf8aa9

URL: 
https://github.com/llvm/llvm-project/commit/71811048c0061c2ecf9aa6ce14c41f3f6ecf8aa9
DIFF: 
https://github.com/llvm/llvm-project/commit/71811048c0061c2ecf9aa6ce14c41f3f6ecf8aa9.diff

LOG: [debugserver] Correctly pass argv[0] to execl

The execl function takes both the executable and argv[0].

Added: 
    

Modified: 
    lldb/tools/debugserver/source/DNB.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/DNB.cpp 
b/lldb/tools/debugserver/source/DNB.cpp
index a69fc33fc9b0..7048bec4832a 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -468,8 +468,9 @@ nub_process_t DNBProcessAttach(nub_process_t attach_pid,
 
         snprintf(fdstr, sizeof(fdstr), "--fd=%d", communication_fd);
         snprintf(pidstr, sizeof(pidstr), "--attach=%d", attach_pid);
-        execl(translated_debugserver, "--native-regs", "--setsid", fdstr,
-              "--handoff-attach-from-native", pidstr, (char *)0);
+        execl(translated_debugserver, translated_debugserver, "--native-regs",
+              "--setsid", fdstr, "--handoff-attach-from-native", pidstr,
+              (char *)0);
         DNBLogThreadedIf(LOG_PROCESS, "Failed to launch debugserver for "
                          "translated process: ", errno, strerror(errno));
         __builtin_trap();


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to