From patchwork Mon Apr 30 14:07:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27040 Received: (qmail 23061 invoked by alias); 30 Apr 2018 14:07:41 -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 22709 invoked by uid 89); 30 Apr 2018 14:07:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.200.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Apr 2018 14:07:37 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 0A160400E2FB3 for ; Mon, 30 Apr 2018 09:07:35 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id D9SpfpsbFQUwqD9SpfZstg; Mon, 30 Apr 2018 09:07:35 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:38138 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fD9So-003cQs-QB; Mon, 30 Apr 2018 09:07:34 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 2/6] Remove some uses of is_mi_like_p from py-framefilter.c Date: Mon, 30 Apr 2018 08:07:28 -0600 Message-Id: <20180430140732.21601-3-tom@tromey.com> In-Reply-To: <20180430140732.21601-1-tom@tromey.com> References: <20180430140732.21601-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fD9So-003cQs-QB X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:38138 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Some uses of is_mi_like_p in py-framefilter.c were not needed. In general a call to ui_out::text, ui_out::message, or ui_out::spaces does not need to be guarded -- these are already ignored by MI. ChangeLog 2018-04-29 Tom Tromey * python/py-framefilter.c (py_print_single_arg) (enumerate_locals, py_print_args, py_print_frame): Remove some uses of is_mi_like_p. --- gdb/ChangeLog | 6 ++++++ gdb/python/py-framefilter.c | 23 +++++++---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index 698fd87f4b..4edefd48f9 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -368,8 +368,7 @@ py_print_single_arg (struct ui_out *out, annotate_arg_name_end (); - if (! out->is_mi_like_p ()) - out->text ("="); + out->text ("="); if (print_args_field) out->field_int ("arg", 1); @@ -602,16 +601,11 @@ enumerate_locals (PyObject *iter, if (print_args_field || args_type != NO_VALUES) tuple.emplace (out, nullptr); } - if (! out->is_mi_like_p ()) - { - /* If the output is not MI we indent locals. */ - out->spaces (local_indent); - } + /* If the output is not MI we indent locals. */ + out->spaces (local_indent); out->field_string ("name", sym_name.get ()); - - if (! out->is_mi_like_p ()) - out->text (" = "); + out->text (" = "); if (args_type == MI_PRINT_SIMPLE_VALUES) py_print_type (out, val); @@ -717,16 +711,14 @@ py_print_args (PyObject *filter, out->wrap_hint (" "); annotate_frame_args (); - if (! out->is_mi_like_p ()) - out->text (" ("); + out->text (" ("); if (args_iter != Py_None && (enumerate_args (args_iter.get (), out, args_type, 0, frame) == EXT_LANG_BT_ERROR)) return EXT_LANG_BT_ERROR; - if (! out->is_mi_like_p ()) - out->text (")"); + out->text (")"); return EXT_LANG_BT_OK; } @@ -996,8 +988,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, ui_out_emit_list inner_list_emiter (out, "children"); - if (! out->is_mi_like_p ()) - indent++; + indent++; while ((item = PyIter_Next (elided.get ()))) {