From 24cdb46e9f0a694b4fbc11085e094857f08c0419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Wed, 10 Aug 2016 19:22:45 +0100 Subject: Support setting thread names (MS-Windows) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is done by catching an exception number 0x406d1388 (it has no documented name, though MSDN dubs it "MS_VC_EXCEPTION" in one code example), which is thrown by the program. The exception record contains an ID of a thread and a name to give it. This requires rolling back some changes in handle_exception(), which now again returns more than two distinct values. The new HANDLE_EXCEPTION_IGNORED value means that gdb should just continue, without returning the thread ID up the stack (which would result in further handling of the exception, which is not what we want). gdb/ChangeLog: 2016-08-10 Руслан Ижбулатов Pedro Alves * windows-nat.c (MS_VC_EXCEPTION): New define. (handle_exception_result): New enum. (windows_delete_thread): Free the thread's name. (handle_exception): Handle MS_VC_EXCEPTION. (get_windows_debug_event): Handle HANDLE_EXCEPTION_IGNORED. (windows_thread_name): New function. (windows_target): Install it as to_thread_name method. * NEWS: Mention the thread naming support on MS-Windows. --- gdb/NEWS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/NEWS') diff --git a/gdb/NEWS b/gdb/NEWS index b08d8a0..6f5feb1 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,12 @@ *** Changes since GDB 7.12 +* Support for thread names on MS-Windows. + + GDB now catches and handles the special exception that programs + running on MS-Windows use to assign names to threads in the + debugger. + *** Changes in GDB 7.12 * GDB and GDBserver now build with a C++ compiler by default. -- cgit v1.1