[Lldb-commits] [PATCH] D30844: pthread_setname_np first appeared in glibc 2.12

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 13 04:28:53 PDT 2017


labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

We need the getter code to get the name of the threads of the process we are debugging, so this cannot go away. It also probably does not make sense to move this code into llvm, as it is quite debugger-specific and very unportable.

We probably don't have a test that we read the thread name correctly, so the test suite would not have caught this. I've added a todo for myself to add one.

If you want to get your build working, I suggest you just remove the setting code. It's conceivable that we may want to change the inferior thread name from a debugger, but we don't have that functionality now, and the code is wrong anyway, so there's no harm in removing it.



================
Comment at: source/Plugins/Process/Linux/NativeThreadLinux.cpp:100
   llvm::SmallString<32> thread_name;
-  HostNativeThread::GetName(GetID(), thread_name);
+  llvm::get_thread_name(thread_name);
   return thread_name.c_str();
----------------
This modification is incorrect. The code is supposed to read the name of the thread we are debugging, not our own thread name.


https://reviews.llvm.org/D30844





More information about the lldb-commits mailing list