From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 72EC63858C53; Thu, 14 Apr 2022 18:21:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72EC63858C53 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Implement thread_name for gdbserver X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 44ac251ad202da57e134f160b6831a56a82a8cf0 X-Git-Newrev: 42a59714076cc14b1684ce822d3118835d4c6bbe Message-Id: <20220414182146.72EC63858C53@sourceware.org> Date: Thu, 14 Apr 2022 18:21:46 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 18:21:46 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D42a59714076c= c14b1684ce822d3118835d4c6bbe commit 42a59714076cc14b1684ce822d3118835d4c6bbe Author: Tom Tromey Date: Tue Apr 12 14:27:13 2022 -0600 Implement thread_name for gdbserver =20 This changes gdbserver to implement thread_name method. Diff: --- gdbserver/win32-low.cc | 9 +++++++++ gdbserver/win32-low.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 8fde3e95b2d..16c13f32d77 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -1502,6 +1502,15 @@ win32_process_target::write_pc (struct regcache *reg= cache, CORE_ADDR pc) return (*the_low_target.set_pc) (regcache, pc); } =20 +const char * +win32_process_target::thread_name (ptid_t thread) +{ + windows_thread_info *th + =3D windows_process.thread_rec (current_thread_ptid (), + DONT_INVALIDATE_CONTEXT); + return th->name.get (); +} + /* The win32 target ops object. */ =20 static win32_process_target the_win32_target; diff --git a/gdbserver/win32-low.h b/gdbserver/win32-low.h index 8856a84baa3..a1d74573cc9 100644 --- a/gdbserver/win32-low.h +++ b/gdbserver/win32-low.h @@ -158,6 +158,8 @@ public: bool stopped_by_sw_breakpoint () override; =20 bool supports_stopped_by_sw_breakpoint () override; + + const char *thread_name (ptid_t thread) override; }; =20 /* Retrieve the context for this thread, if not already retrieved. */