diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-07-28 02:40:23 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-08-23 17:07:42 +0300 |
commit | 9e0f9ec7aedb59cacaf5831a27b925d791090113 (patch) | |
tree | 2c0578bb4a92c36a8f06e95ca5e7dfd373abd792 /winsup/cygwin/net.cc | |
parent | fdb7df230ded019be0472565d79de14fe677dea7 (diff) |
Send thread names to debugger
GDB since commit 24cdb46e [1] can report and use these names.
Add utility function SetThreadName(), which sends a thread name to the
debugger.
Use that:
- to set the default thread name for main thread and newly created pthreads.
- in pthread_setname_np() for user thread names.
- for helper thread names in cygthread::create()
- for helper threads which are created directly with CreateThread.
Note that there can still be anonymous threads, created by system or
injected DLLs.
[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24cdb46e9f0a694b4fbc11085e094857f08c0419
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 52b3d9874..e4805d3e1 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1819,6 +1819,7 @@ get_adapters_addresses (PIP_ADAPTER_ADDRESSES *pa_ret, ULONG family) The OS allocates stacks bottom up, so chances are good that the new stack will be located in the lower address area. */ HANDLE thr = CreateThread (NULL, 0, call_gaa, ¶m, 0, NULL); + SetThreadName (GetThreadId (thr), "__call_gaa"); if (!thr) { debug_printf ("CreateThread: %E"); |