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

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 28 11:35:08 PDT 2019


wallace marked an inline comment as done.
wallace added inline comments.


================
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();
----------------
labath wrote:
> 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 ?
you are right! I'll just use it directly


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