Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [2/3] RFC: *stopped and CLI commands
Date: Tue, 22 Nov 2011 20:05:00 -0000	[thread overview]
Message-ID: <m3bos33oua.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201111221508.30259.pedro@codesourcery.com> (Pedro Alves's	message of "Tue, 22 Nov 2011 15:08:30 +0000")

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> On Wednesday 16 November 2011 20:00:30, Tom Tromey wrote:
>> diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
>> index 805e3f8..2aec1c7 100644
>> --- a/gdb/mi/mi-interp.c
>> +++ b/gdb/mi/mi-interp.c
>> @@ -429,6 +429,7 @@ mi_on_normal_stop (struct bpstats *bs, int print_frame)
>> struct ui_out *saved_uiout = current_uiout;
>> 
>> current_uiout = mi_uiout;
>> +         bpstat_print (bs);
>> print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
>> current_uiout = saved_uiout;
>> }

Pedro> Hmm, I should have read this one first.  This means that with
Pedro> patch 3 we'll print "Stopped due to ..." twice?

Yes, I hadn't noticed that.  Oops.

However, we still need this call in order to get the reason= output in
the MI notification when the command was a CLI command.  That is, if you
omit this call, you get:

    (gdb) 
    run
    &"run\n"
    ~"Starting program: /home/tromey/Space/SecondArcher/build/gdb/testsuite/gdb.mi/solib-main \n"
    =thread-group-started,id="i1",pid="32683"
    =thread-created,id="1",group-id="i1"
    ^running
    *running,thread-id="all"
    (gdb) 
    =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
    ~"Stopped due to shared library event\n"
    *stopped,frame={addr="0x0000003a15c0ea20",func="__GI__dl_debug_state",args=[],file="dl-debug.c",fullname="/usr/src/debug/glibc-2.14-34-ge2a3090/elf/dl-debug.c",line="77"},thread-id="1",stopped-threads="all",core="2"



Note how the *stopped doesn't have a reason.

The fix is to leave this call to bpstat_print, but to change the
printing of "Stopped due to shared library event" to use ui_out_text
rather than printf_filtered.  This eliminates the double printing.

Tom


  reply	other threads:[~2011-11-22 20:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 20:00 Tom Tromey
2011-11-22 15:08 ` Pedro Alves
2011-11-22 20:05   ` Tom Tromey [this message]
2011-11-22 20:48     ` Pedro Alves

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=m3bos33oua.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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