labath added a comment.

This looks pretty good. I just have one quick question about the /comm file.



================
Comment at: lldb/source/Host/linux/Host.cpp:205-222
+static bool GetProcessNameFromStat(::pid_t pid, std::string& name) {
+  auto BufferOrError = getProcFile(pid, "stat");
+  if (!BufferOrError)
+    return false;
+
+  std::unique_ptr<llvm::MemoryBuffer> Stat = std::move(*BufferOrError);
+  llvm::StringRef Rest = Stat->getBuffer();
----------------
This should return the same value as `/proc/<pid>/comm`, except that you don't 
need to do any fancy parsing. Are there any cases where we cannot just read the 
/comm file ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68968



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D... Pavel Labath via Phabricator via lldb-commits

Reply via email to