JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM modulo code duplication.



================
Comment at: lldb/tools/debugserver/source/RNBRemote.cpp:3639-3644
+  struct proc_bsdshortinfo proc;
+  int ppid = 0;
+  if (proc_pidinfo(pid, PROC_PIDT_SHORTBSDINFO, 0, &proc,
+                   PROC_PIDT_SHORTBSDINFO_SIZE) == sizeof(proc)) {
+    ppid = proc.pbsi_ppid;
+  }
----------------
As this is the exact same code as in `MachProcess.mm`, is this worth factoring 
out? Something like 

```
std::optional<int> GetAttachedProcPID() {
  struct proc_bsdshortinfo proc;
  if (proc_pidinfo(pid, PROC_PIDT_SHORTBSDINFO, 0, &proc,
                   PROC_PIDT_SHORTBSDINFO_SIZE) == sizeof(proc)) {
    return proc.pbsi_ppid;
  }
  return std::null opt;
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155037

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

Reply via email to