[PATCH 0/9] Windows thread names

Tom Tromey tromey@adacore.com
Wed Apr 13 19:17:47 GMT 2022


I noticed that newer versions of Windows have a nicer API to setting
and fetching a thread's name.  Whereas in earlier versions this was
done by throwing and catching a special SEH exception, that the
debugger could intercept, now there is a simple API call.

I also noticed that, while gdb implements the older method already,
gdbserver did not.

This patch refactors some code a little bit so that the old method can
be shared between gdb and gdbserver.  Then it implements the new
method as well, and also changes gdb to set the names of its own
worker threads using the new approach.

I ran this through the AdaCore test suite without problems, and also
tested it by hand on a simple program that sets the current thread's
name.

Tom




More information about the Gdb-patches mailing list