From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id 2F1A43857806 for ; Wed, 13 Apr 2022 19:17:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F1A43857806 Received: by mail-io1-xd34.google.com with SMTP id y65so3034754iof.1 for ; Wed, 13 Apr 2022 12:17:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=6FgG0QzbwPsfn7ZisXkIPAwKkBwUy++9e6Fubg5Yqcg=; b=dzh5/154QUO/JhsmPp0yS8wnKtvRqCZyA7hIY2bo/NgxLMmUxJasRCLJkAizhfe+kZ 6ySUJoFKhKgCwaDZfZX2/ECN8+bda2rFEwAplH4n/8Ycw0JrjonmgWMNzcChkVHPEMdj U/s/2flOdf3qive2fJfg9wYsV03tzBstiIuvmygCBR5lEIXQq04c2lzQJA/IJvsQ7qhI chVjRMytL9oNtE0uibYfAGdXs6I0W3GxzOygepLy69stWVqQCivmZ8blhJaDaAwBasN1 ozFxgQrbVETY3JMwjUgMfB/2WGfPlnTBWPhSPQWV+skWBxSHnIRXDULHZ1FAXSosdpMZ xk0Q== X-Gm-Message-State: AOAM5317GS34zTqujLz+7tEKaX8JvoKIdM01z8Zm7s3snTvQm6MGP7PO GN1+BKmM1EO37TVkeVPLKvvLYXVR8lmJNw== X-Google-Smtp-Source: ABdhPJw8JTyzuTPqRIE3RSN+TiPqLUnYISyBWxBye3WprDMJ0d+BPBZ3aygqCoFnMyHdV+/gKDeGnQ== X-Received: by 2002:a05:6638:e8d:b0:326:684e:ab4c with SMTP id p13-20020a0566380e8d00b00326684eab4cmr2526929jas.186.1649877478410; Wed, 13 Apr 2022 12:17:58 -0700 (PDT) Received: from murgatroyd.Home (71-211-154-204.hlrn.qwest.net. [71.211.154.204]) by smtp.gmail.com with ESMTPSA id e203-20020a6bb5d4000000b0064dafa0416fsm427660iof.2.2022.04.13.12.17.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 12:17:57 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 0/9] Windows thread names Date: Wed, 13 Apr 2022 13:17:47 -0600 Message-Id: <20220413191756.1146768-1-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2022 19:18:00 -0000 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