From 71811048c0061c2ecf9aa6ce14c41f3f6ecf8aa9 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 15 Feb 2021 18:38:21 -0800 Subject: [PATCH] [debugserver] Correctly pass argv[0] to execl The execl function takes both the executable and argv[0]. --- lldb/tools/debugserver/source/DNB.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp index a69fc33..7048bec 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(); -- 2.7.4