aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-09-09 22:51:58 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-09-09 22:51:58 +0200
commit0d64823e51de0b0e0a94bdf88940310342a6e6fa (patch)
treedb293235435a849e602a99c2d2bd176dc03bf5dc
parenteb1e02fd05688c28686a02f197c5e7cb0a5d6a27 (diff)
downloadfsf-binutils-gdb-0d64823e51de0b0e0a94bdf88940310342a6e6fa.zip
fsf-binutils-gdb-0d64823e51de0b0e0a94bdf88940310342a6e6fa.tar.gz
fsf-binutils-gdb-0d64823e51de0b0e0a94bdf88940310342a6e6fa.tar.bz2
Remove unnecessary calls to is_mi_like_p in print_thread_info_1
There are two calls to uiout->is_mi_like_p in the else branch of a if (uiout->is_mi_like_p ()), we already know they will return false. A bit lower, there are two if (!uiout->is_mi_like_p ()) that we can merge. gdb/ChangeLog: * thread.c (print_thread_info_1): Remove unnecessary calls to uiout->is_mi_like_p.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/thread.c15
2 files changed, 10 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1bcc95a..e8c69f5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-09 Simon Marchi <simon.marchi@ericsson.com>
+
+ * thread.c (print_thread_info_1): Remove unnecessary calls to
+ uiout->is_mi_like_p.
+
2017-09-09 Tom Tromey <tom@tromey.com>
* namespace.h (add_using_directive): Update.
diff --git a/gdb/thread.c b/gdb/thread.c
index af7900d..2539d43 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1276,16 +1276,12 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
return;
}
- table_emitter.emplace (uiout,
- (show_global_ids || uiout->is_mi_like_p ())
- ? 5 : 4,
+ table_emitter.emplace (uiout, show_global_ids ? 5 : 4,
n_threads, "threads");
uiout->table_header (1, ui_left, "current", "");
-
- if (!uiout->is_mi_like_p ())
- uiout->table_header (4, ui_left, "id-in-tg", "Id");
- if (show_global_ids || uiout->is_mi_like_p ())
+ uiout->table_header (4, ui_left, "id-in-tg", "Id");
+ if (show_global_ids)
uiout->table_header (4, ui_left, "id", "GId");
uiout->table_header (17, ui_left, "target-id", "Target Id");
uiout->table_header (1, ui_left, "frame", "Frame");
@@ -1311,10 +1307,9 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
uiout->field_string ("current", "*");
else
uiout->field_skip ("current");
- }
- if (!uiout->is_mi_like_p ())
- uiout->field_string ("id-in-tg", print_thread_id (tp));
+ uiout->field_string ("id-in-tg", print_thread_id (tp));
+ }
if (show_global_ids || uiout->is_mi_like_p ())
uiout->field_int ("id", tp->global_num);