From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9217 invoked by alias); 23 May 2014 03:48:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 9189 invoked by uid 89); 23 May 2014 03:48:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 May 2014 03:48:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WngTH-0005ed-Uv from Yao_Qi@mentor.com ; Thu, 22 May 2014 20:48:39 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 May 2014 20:48:39 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Thu, 22 May 2014 20:48:38 -0700 Message-ID: <537EC488.7020709@codesourcery.com> Date: Fri, 23 May 2014 03:48:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH] PR gdb/13860 - Make MI sync vs async output (closer to) the same. References: <1400782475-27630-1-git-send-email-palves@redhat.com> In-Reply-To: <1400782475-27630-1-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00574.txt.bz2 The patch looks good. One question and two suggestions below: On 05/23/2014 02:14 AM, Pedro Alves wrote: > Fix this by making run control event printing roughly independent of > whatever is the current interpreter or uiout. That is, move these > prints to interpreter observers, that know whether to print or be > quiet, and if printing, which uiout to print to. In the case of the > console/tui interpreters, only print if the top interpreter. For MI, > always print. Currently, run control prints events directly to uiout and it has to worry about different interpreters. Looks your change is like delegating print events to interpreter and let each interpreter decide what uiout to use and how to print. If my understand is correct, we'd better document somewhere in code that run control should delegate events printing to interpreter, instead of printing events directly. > > Breakpoint hits / normal stops are already handled similarly -- MI has > a normal_stop observer that prints the event to both MI and the CLI, > though that could be cleaned up further in the direction of this > patch. Do you mean we can clean up print_stop_event in the same way you did in this patch? > diff --git a/gdb/infrun.h b/gdb/infrun.h > index f0649f3..47509d9 100644 > --- a/gdb/infrun.h > +++ b/gdb/infrun.h > @@ -120,6 +120,29 @@ extern int stepping_past_instruction_at (struct address_space *aspace, > extern void set_step_info (struct frame_info *frame, > struct symtab_and_line sal); > > +/* Several print_*_reason helper functions to print why the inferior > + has stopped to the passed in UIOUT. The interpreters call > + these. */ > + > +/* Signal received, print why the inferior has stopped. */ > +extern void print_signal_received_reason (struct ui_out *uiout, > + enum gdb_signal siggnal); > + > +/* Print why the inferior has stopped. We are done with a > + step/next/si/ni command, print why the inferior has stopped. */ > +extern void print_end_stepping_range_reason (struct ui_out *uiout); > + > +/* The inferior was terminated by a signal, print why it stopped. */ > +extern void print_signal_exited_reason (struct ui_out *uiout, > + enum gdb_signal siggnal); > + > +/* The inferior program is finished, print why it stopped. */ > +extern void print_exited_reason (struct ui_out *uiout, int exitstatus); > + > +/* Reverse execution: target ran out of history info, print why the > + inferior has stopped. */ > +extern void print_no_history_reason (struct ui_out *uiout); > + > extern void print_stop_event (struct target_waitstatus *ws); > > extern int signal_stop_state (int); I'd like to move these declarations to interps.h or interp-internal.h, because these functions are only used by different interpreters, and they can be invisible out side of interpreters. -- Yao (齐尧)