[Lldb-commits] [PATCH] D70363: [lldb] [Process/NetBSD] Implement thread name getting

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 18 00:10:19 PST 2019


labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/main.cpp:13
+  ::pthread_setname_np(::pthread_self(), "%s",
+                       const_cast<void *>(static_cast<const void *>(name)));
 #endif
----------------
I think `const_cast<char *>(name)` ought to be enough.


================
Comment at: lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp:122
+  if (::sysctl(mib, 5, nullptr, &size, nullptr, 0) == -1 || size == 0) {
+    LLDB_LOG(log, "sysctl() for LWP info size failed: {0}", strerror(errno));
+    return "";
----------------
Thread-safety technically doesn't matter in this part of the code, but I think it would be good practice to use `llvm::StrError` (`llvm/Support/Errno.h`) anyway. 


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

https://reviews.llvm.org/D70363





More information about the lldb-commits mailing list