public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH v2 05/12] Change names given to Ravenscar threads
Date: Wed,  5 Aug 2020 13:08:34 -0600	[thread overview]
Message-ID: <20200805190841.2506771-6-tromey@adacore.com> (raw)
In-Reply-To: <20200805190841.2506771-1-tromey@adacore.com>

Current a Ravenscar thread is given the same sort of name as a "CPU"
thread; they can only be distinguished by looking at the output of
"info thread".

This patch changes ravenscar-thread.c to distinguish these threads,
like:

    (gdb) continue
    Continuing.
    [New Ravenscar Thread 0x2b910]

2019-03-26  Tom Tromey  <tromey@adacore.com>

	* ravenscar-thread.c (ravenscar_thread_target) <extra_thread_info>:
	Remove.
	(ravenscar_thread_target::extra_thread_info): Remove.
	(ravenscar_thread_target::pid_to_str): Mention Ravenscar in result;
	defer to target beneath for non-Ravenscar threads.
---
 gdb/ChangeLog          |  8 ++++++++
 gdb/ravenscar-thread.c | 13 ++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index ee95a1c4bb8..dbcd4de81f8 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -109,8 +109,6 @@ struct ravenscar_thread_target final : public target_ops
 
   void update_thread_list () override;
 
-  const char *extra_thread_info (struct thread_info *) override;
-
   std::string pid_to_str (ptid_t) override;
 
   ptid_t get_ada_task_ptid (long lwp, long thread) override;
@@ -414,12 +412,6 @@ ravenscar_thread_target::active_task (int cpu)
     return ptid_t (m_base_ptid.pid (), 0, tid);
 }
 
-const char *
-ravenscar_thread_target::extra_thread_info (thread_info *tp)
-{
-  return "Ravenscar task";
-}
-
 bool
 ravenscar_thread_target::thread_alive (ptid_t ptid)
 {
@@ -430,7 +422,10 @@ ravenscar_thread_target::thread_alive (ptid_t ptid)
 std::string
 ravenscar_thread_target::pid_to_str (ptid_t ptid)
 {
-  return string_printf ("Thread %#x", (int) ptid.tid ());
+  if (!is_ravenscar_task (ptid))
+    return beneath ()->pid_to_str (ptid);
+
+  return string_printf ("Ravenscar Thread %#x", (int) ptid.tid ());
 }
 
 void
-- 
2.26.2


  parent reply	other threads:[~2020-08-05 19:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 19:08 [PATCH v2 00/12] Fix Ravenscar regressions Tom Tromey
2020-08-05 19:08 ` [PATCH v2 01/12] Call add_active_thread after pushing the ravenscar target Tom Tromey
2020-08-05 19:08 ` [PATCH v2 02/12] Avoid crash in ravenscar_thread_target::wait Tom Tromey
2020-08-05 19:08 ` [PATCH v2 03/12] Return event_ptid from ravenscar_thread_target::wait Tom Tromey
2020-08-05 19:08 ` [PATCH v2 04/12] Handle case where Ada task is current but not listed Tom Tromey
2020-08-05 19:08 ` Tom Tromey [this message]
2020-08-05 19:08 ` [PATCH v2 06/12] Use gdb::function_view in iterate_over_live_ada_tasks Tom Tromey
2020-08-05 19:08 ` [PATCH v2 07/12] Wrap xfer_partial and enable_btrace for Ravenscar Tom Tromey
2020-08-05 19:08 ` [PATCH v2 08/12] Update Ravenscar documentation Tom Tromey
2020-08-05 19:08 ` [PATCH v2 09/12] Fix Ravenscar "process" resume Tom Tromey
2020-08-05 19:08 ` [PATCH v2 10/12] Fetch registers from correct thread in ravenscar-thread.c Tom Tromey
2020-08-05 19:08 ` [PATCH v2 11/12] Set inferior_ptid in ravenscar_thread_target::update_thread_list Tom Tromey
2020-08-05 19:08 ` [PATCH v2 12/12] Fix remaining Ravenscar regressions Tom Tromey
2020-08-07 15:03 ` [PATCH v2 00/12] Fix " Joel Brobecker
2020-08-07 16:26   ` Tom Tromey
2020-08-07 17:11   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200805190841.2506771-6-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).