[Lldb-commits] [PATCH] D72813: Fixes to lldb's eLaunchFlagLaunchInTTY feature on macOS

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 15 17:10:54 PST 2020


clayborg added inline comments.


================
Comment at: lldb/source/Host/macosx/objcxx/Host.mm:154-155
+      // started, and stop at dyld_start, before we attach.
+      const int short_sleep = 100000; // 0.1 seconds
+      ::usleep(short_sleep);
+
----------------
This seems racy still?


================
Comment at: lldb/source/Host/macosx/objcxx/Host.mm:159
-  const int time_delta_usecs = 100000;
-  const int num_retries = timeout_in_seconds / time_delta_usecs;
-  for (int i = 0; i < num_retries; i++) {
----------------
So if we fix this line to be:

```
const int num_retries = timeout_in_seconds * USEC_PER_SEC / time_delta_usecs;
```

This doesn't work? I am assuming you tried this?


================
Comment at: lldb/tools/darwin-debug/darwin-debug.cpp:161
+    perror("error: send (socket_fd, pid_str, pid_str_len, 0)");
+    exit(1);
+  }
----------------
"close(socket_fd)" here if we fail and are going to exit?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72813/new/

https://reviews.llvm.org/D72813





More information about the lldb-commits mailing list