Can we just copy the non portable system call to this location and inline it here with appropriate glibc check so that we can still delete all that other obsolete code?<br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 13, 2017 at 4:28 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath requested changes to this revision.<br class="gmail_msg">
labath added a comment.<br class="gmail_msg">
This revision now requires changes to proceed.<br class="gmail_msg">
<br class="gmail_msg">
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.<br class="gmail_msg">
<br class="gmail_msg">
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.<br class="gmail_msg">
<br class="gmail_msg">
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.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: source/Plugins/Process/Linux/NativeThreadLinux.cpp:100<br class="gmail_msg">
   llvm::SmallString<32> thread_name;<br class="gmail_msg">
-  HostNativeThread::GetName(GetID(), thread_name);<br class="gmail_msg">
+  llvm::get_thread_name(thread_name);<br class="gmail_msg">
   return thread_name.c_str();<br class="gmail_msg">
----------------<br class="gmail_msg">
This modification is incorrect. The code is supposed to read the name of the thread we are debugging, not our own thread name.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D30844" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D30844</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>