Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Don't show "display"s twice in MI
Date: Tue, 12 Mar 2019 21:26:00 -0000	[thread overview]
Message-ID: <35e26a8109be1f127b2d2bdd0003a980@polymtl.ca> (raw)
In-Reply-To: <20190312190320.19645-1-tromey@adacore.com>

On 2019-03-12 15:03, Tom Tromey wrote:
> If you run "gdb -i=mi2" and set a "display", then when "next"ing the
> displays will be shown twice:
> 
>     ~"1: x = 23\n"
>     ~"7\t  printf(\"%d\\n\", x);\n"
>     ~"1: x = 23\n"
> 
> *stopped,reason="end-stepping-range",frame={addr="0x0000000000400565",func="main",args=[],file="q.c",fullname="/tmp/q.c",line="7"},thread-id="1",stopped-threads="all",core="1"
> 
> The immediate cause of this is this code in mi_on_normal_stop_1:
> 
>       print_stop_event (mi_uiout);
> 
>       console_interp = interp_lookup (current_ui, INTERP_CONSOLE);
>       if (should_print_stop_to_console (console_interp, tp))
> 	print_stop_event (mi->cli_uiout);
> 
> ... which obviously prints the stop twice.
> 
> However, I think the first call to print_stop_event is intended just
> to emit the MI *stopped notification, which explains why the source
> line does not show up two times.
> 
> This patch fixes the bug by changing print_stop_event to only call
> do_displays for non-MI-like ui-outs.

FWIW, this is fine with me.  Maybe just format the C file of the test 
case according to GNU style.

Simon


  reply	other threads:[~2019-03-12 21:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 19:03 Tom Tromey
2019-03-12 21:26 ` Simon Marchi [this message]
2019-03-13 15:04 ` Pedro Alves
2019-03-13 15:17   ` Tom Tromey
2019-03-13 15:50     ` Pedro Alves
2019-03-13 21:02       ` Tom Tromey
2019-03-19 17:46         ` Pedro Alves
2019-03-13 18:41     ` André Pönitz

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=35e26a8109be1f127b2d2bdd0003a980@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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