This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [2/3] RFC: *stopped and CLI commands

>>>>> "Pedro" == Pedro Alves <> 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:

    ~"Starting program: /home/tromey/Space/SecondArcher/build/gdb/testsuite/gdb.mi/solib-main \n"
    ~"Stopped due to shared library event\n"

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]