Skip to content

Commit 29f3f60

Browse files
authored
Merge pull request #9381 from jasonmolenda/cp/r135641680-debugserver-error-out-if-cannot-find-rosetta-debugserver-20240723
[lldb][debugserver] Check if Rosetta debugserver exists (llvm#110943)
2 parents d93fb41 + b854d8d commit 29f3f60

File tree

1 file changed

+11
-3
lines changed
  • lldb/tools/debugserver/source

1 file changed

+11
-3
lines changed

lldb/tools/debugserver/source/DNB.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,17 @@ nub_process_t DNBProcessAttach(nub_process_t attach_pid,
475475
extern int communication_fd;
476476

477477
if (communication_fd == -1) {
478-
fprintf(stderr, "Trying to attach to a translated process with the "
479-
"native debugserver, exiting...\n");
480-
exit(1);
478+
DNBLogError("Trying to attach to a translated process with the "
479+
"native debugserver, exiting...\n");
480+
return INVALID_NUB_PROCESS_ARCH;
481+
}
482+
483+
struct stat st;
484+
if (::stat(translated_debugserver, &st) != 0) {
485+
DNBLogError("Translated inferior process but Rosetta debugserver not "
486+
"found at %s",
487+
translated_debugserver);
488+
return INVALID_NUB_PROCESS_ARCH;
481489
}
482490

483491
snprintf(fdstr, sizeof(fdstr), "--fd=%d", communication_fd);

0 commit comments

Comments
 (0)