This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove dead code and "current" field from MI thread output doc


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9be21bb4d4f30975766dfaa7d40b53ba10dcc3a0

commit 9be21bb4d4f30975766dfaa7d40b53ba10dcc3a0
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Fri Apr 21 21:45:15 2017 -0400

    Remove dead code and "current" field from MI thread output doc
    
    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.

Diff:
---
 gdb/ChangeLog       |  4 ++++
 gdb/doc/ChangeLog   |  5 +++++
 gdb/doc/gdb.texinfo |  3 ---
 gdb/thread.c        | 10 +---------
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b657685..2aa0b59 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-21  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* thread.c (print_thread_info_1): Remove dead code.
+
 2017-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index c542c0b..efce1c0 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-21  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* gdb.texinfo (GDB/MI Thread Commands): Remove "current" field
+	from -thread-info output.
+
 2017-03-28  Anton Kolesov  <anton.kolesov@synopsys.com>
 
 	* gdb.texinfo (Synopsys ARC): Document "set debug arc 2".
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 300d78e..9e87276 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 e4113c2..7ce65ff 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1308,15 +1308,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", "*");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]