Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] Remove dead code and "current" field from MI thread output doc
@ 2017-04-12 18:06 Simon Marchi
  2017-04-12 18:07 ` [PATCH 2/2] doc: Improve documentation about MI thread output Simon Marchi
  2017-04-12 19:14 ` [PATCH 1/2] Remove dead code and "current" field from MI thread output doc Eli Zaretskii
  0 siblings, 2 replies; 12+ messages in thread
From: Simon Marchi @ 2017-04-12 18:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The MI documentation says that -thread-info output contains a "current"
field in the current thread tuple, with the value "*".  Current GDB
master does not do this, and I couldn't find any GDB version that did.
I suspect that it was never the case.

The code that would correspond to this in print_thread_info_1 is
essentially dead code.  The calls to uiout->text end up in
mi_out::do_text, which is empty.

This patch removes the documentation bit and the dead code.  This
"current" field is not necessary, since -thread-info outputs a
"current-thread-id" field.

gdb/ChangeLog:

	* thread.c (print_thread_info_1): Remove dead code.

gdb/doc/ChangeLog:

	* gdb.texinfo (GDB/MI Thread Commands): Remove "current" field
	from -thread-info output.
---
 gdb/doc/gdb.texinfo |  3 ---
 gdb/thread.c        | 10 +---------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 300d78eefb..9e872763b2 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -28088,9 +28088,6 @@ The result is a list of threads.  The following attributes are
 defined for a given thread:
 
 @table @samp
-@item current
-This field exists only for the current thread.  It has the value @samp{*}.
-
 @item id
 The global identifier that @value{GDBN} uses to refer to the thread.
 
diff --git a/gdb/thread.c b/gdb/thread.c
index abfce71eda..74d0d65e02 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1283,15 +1283,7 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
 
       chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
 
-      if (uiout->is_mi_like_p ())
-	{
-	  /* Compatibility.  */
-	  if (tp->ptid == current_ptid)
-	    uiout->text ("* ");
-	  else
-	    uiout->text ("  ");
-	}
-      else
+      if (!uiout->is_mi_like_p ())
 	{
 	  if (tp->ptid == current_ptid)
 	    uiout->field_string ("current", "*");
-- 
2.11.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-04-22  1:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 18:06 [PATCH 1/2] Remove dead code and "current" field from MI thread output doc Simon Marchi
2017-04-12 18:07 ` [PATCH 2/2] doc: Improve documentation about MI thread output Simon Marchi
2017-04-12 18:17   ` Simon Marchi
2017-04-12 19:18   ` Eli Zaretskii
2017-04-12 19:26     ` Simon Marchi
2017-04-12 19:32       ` Eli Zaretskii
2017-04-12 20:10         ` Simon Marchi
2017-04-12 20:34           ` Eli Zaretskii
2017-04-12 21:13             ` Simon Marchi
2017-04-13  6:02               ` Eli Zaretskii
2017-04-22  1:57                 ` Simon Marchi
2017-04-12 19:14 ` [PATCH 1/2] Remove dead code and "current" field from MI thread output doc Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox