[Lldb-commits] [PATCH] D68968: [android/process info] Introduce display_name

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 28 06:55:06 PDT 2019


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





More information about the lldb-commits mailing list