From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 2/6] Remove some uses of is_mi_like_p from py-framefilter.c
Date: Mon, 30 Apr 2018 14:07:00 -0000 [thread overview]
Message-ID: <20180430140732.21601-3-tom@tromey.com> (raw)
In-Reply-To: <20180430140732.21601-1-tom@tromey.com>
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 <tom@tromey.com>
* 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 ())))
{
--
2.13.6
next prev parent reply other threads:[~2018-04-30 14:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 14:07 [RFA 0/6] Remove some uses of is_mi_like_p Tom Tromey
2018-04-30 14:07 ` [RFA 6/6] Remove a use of is_mi_like_p from darwin-nat-info.c Tom Tromey
2018-04-30 14:07 ` [RFA 4/6] Remove a use of is_mi_like_p from tracepoint.c Tom Tromey
2018-04-30 14:07 ` [RFA 1/6] Make do_is_mi_like_p const Tom Tromey
2018-04-30 14:07 ` [RFA 5/6] Remove some is_mi_like_p from breakpoint code Tom Tromey
2018-04-30 14:07 ` Tom Tromey [this message]
2018-04-30 14:07 ` [RFA 3/6] Remove some uses of is_mi_like_p from spu-tdep.c Tom Tromey
2018-04-30 18:36 ` [RFA 0/6] Remove some uses of is_mi_like_p Pedro Alves
2018-04-30 18:52 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180430140732.21601-3-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).