From patchwork Thu Jan 9 22:03:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 37277 Received: (qmail 17116 invoked by alias); 9 Jan 2020 22:03:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17089 invoked by uid 89); 9 Jan 2020 22:03:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail.efficios.com Received: from mail.efficios.com (HELO mail.efficios.com) (167.114.142.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jan 2020 22:03:12 +0000 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id AF0BD6961B0 for ; Thu, 9 Jan 2020 17:03:10 -0500 (EST) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id WCr_Umglv6Mz; Thu, 9 Jan 2020 17:03:10 -0500 (EST) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 3B8E26961AC; Thu, 9 Jan 2020 17:03:10 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 3B8E26961AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578607390; bh=ebzImrp26GVjQoYldOQuxP0kwtEaeeMMwcEF8ZV0gXU=; h=From:To:Date:Message-Id:MIME-Version; b=YbfP8Bvz8oW/pSr+7X/l1uAjCIUZvviNikE16t2ehPPWw6uQcQqR7LCDEy+3NsJDi IOU07Uw5ZuanY9Z9Qu4q3yn8yyR41HYph86niukwYLB4wkCBT3la+3n2vh/gN1l6B7 0IBcEfmpPCXKnCHqrb0oe/Cb1PL/ECrXym7el0p+Rnu9+6MtXUzdXoSZbT/TjuWJOq pcbV8SqlEGuCYmNHHK4LHMjamzc25PpUX0EDMq8UAVpCLqEeEOqJSU3pCHxYZLj974 VFV+BjJsldDemLw48HGAgZvRE3e8NnvFPdAkE/td+yeH1aDj8rwmZ5K0VH94cFoAnc 40znrRoCO0aeQ== Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id tyQARCfioa7K; Thu, 9 Jan 2020 17:03:10 -0500 (EST) Received: from smarchi-efficios.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by mail.efficios.com (Postfix) with ESMTPSA id 14B8E6961A6; Thu, 9 Jan 2020 17:03:10 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] Fix indentation in print_thread_info_1 Date: Thu, 9 Jan 2020 17:03:03 -0500 Message-Id: <20200109220303.2269-1-simon.marchi@efficios.com> MIME-Version: 1.0 The body of this this big "for" loop is missing an indentation level, this patch fixes that. gdb/ChangeLog: * thread.c (print_thread_info_1): Fix indentation. --- gdb/ChangeLog | 4 ++ gdb/thread.c | 130 +++++++++++++++++++++++++------------------------- 2 files changed, 69 insertions(+), 65 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ba163400899..d22a5e12d6e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-01-08 Simon Marchi + + * thread.c (print_thread_info_1): Fix indentation. + 2020-01-09 Christian Biesinger * symtab.c (general_symbol_info::compute_and_set_names): Move the diff --git a/gdb/thread.c b/gdb/thread.c index f171e2e3b634..4959f938c7f3 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1090,85 +1090,85 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads, for (inferior *inf : all_inferiors ()) for (thread_info *tp : inf->threads ()) - { - int core; + { + int core; - any_thread = true; - if (tp == current_thread && tp->state == THREAD_EXITED) - current_exited = true; + any_thread = true; + if (tp == current_thread && tp->state == THREAD_EXITED) + current_exited = true; - if (!should_print_thread (requested_threads, default_inf_num, - global_ids, pid, tp)) - continue; + if (!should_print_thread (requested_threads, default_inf_num, + global_ids, pid, tp)) + continue; - ui_out_emit_tuple tuple_emitter (uiout, NULL); + ui_out_emit_tuple tuple_emitter (uiout, NULL); - if (!uiout->is_mi_like_p ()) - { - if (tp == current_thread) - uiout->field_string ("current", "*"); - else - uiout->field_skip ("current"); + if (!uiout->is_mi_like_p ()) + { + if (tp == current_thread) + uiout->field_string ("current", "*"); + else + uiout->field_skip ("current"); - 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_signed ("id", tp->global_num); + if (show_global_ids || uiout->is_mi_like_p ()) + uiout->field_signed ("id", tp->global_num); - /* For the CLI, we stuff everything into the target-id field. - This is a gross hack to make the output come out looking - correct. The underlying problem here is that ui-out has no - way to specify that a field's space allocation should be - shared by several fields. For MI, we do the right thing - instead. */ + /* For the CLI, we stuff everything into the target-id field. + This is a gross hack to make the output come out looking + correct. The underlying problem here is that ui-out has no + way to specify that a field's space allocation should be + shared by several fields. For MI, we do the right thing + instead. */ - if (uiout->is_mi_like_p ()) - { - uiout->field_string ("target-id", target_pid_to_str (tp->ptid)); + if (uiout->is_mi_like_p ()) + { + uiout->field_string ("target-id", target_pid_to_str (tp->ptid)); - const char *extra_info = target_extra_thread_info (tp); - if (extra_info != nullptr) - uiout->field_string ("details", extra_info); + const char *extra_info = target_extra_thread_info (tp); + if (extra_info != nullptr) + uiout->field_string ("details", extra_info); - const char *name = (tp->name != nullptr - ? tp->name - : target_thread_name (tp)); - if (name != NULL) - uiout->field_string ("name", name); - } - else - { - uiout->field_string ("target-id", - thread_target_id_str (tp).c_str ()); - } + const char *name = (tp->name != nullptr + ? tp->name + : target_thread_name (tp)); + if (name != NULL) + uiout->field_string ("name", name); + } + else + { + uiout->field_string ("target-id", + thread_target_id_str (tp).c_str ()); + } - if (tp->state == THREAD_RUNNING) - uiout->text ("(running)\n"); - else - { - /* The switch below puts us at the top of the stack (leaf - frame). */ - switch_to_thread (tp); - print_stack_frame (get_selected_frame (NULL), - /* For MI output, print frame level. */ - uiout->is_mi_like_p (), - LOCATION, 0); - } + if (tp->state == THREAD_RUNNING) + uiout->text ("(running)\n"); + else + { + /* The switch below puts us at the top of the stack (leaf + frame). */ + switch_to_thread (tp); + print_stack_frame (get_selected_frame (NULL), + /* For MI output, print frame level. */ + uiout->is_mi_like_p (), + LOCATION, 0); + } - if (uiout->is_mi_like_p ()) - { - const char *state = "stopped"; + if (uiout->is_mi_like_p ()) + { + const char *state = "stopped"; - if (tp->state == THREAD_RUNNING) - state = "running"; - uiout->field_string ("state", state); - } + if (tp->state == THREAD_RUNNING) + state = "running"; + uiout->field_string ("state", state); + } - core = target_core_of_thread (tp->ptid); - if (uiout->is_mi_like_p () && core != -1) - uiout->field_signed ("core", core); - } + core = target_core_of_thread (tp->ptid); + if (uiout->is_mi_like_p () && core != -1) + uiout->field_signed ("core", core); + } /* This end scope restores the current thread and the frame selected before the "info threads" command, and it finishes the