From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30509 invoked by alias); 4 May 2013 04:41:26 -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 30499 invoked by uid 89); 4 May 2013 04:41:26 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ve0-f175.google.com (HELO mail-ve0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 04 May 2013 04:41:24 +0000 Received: by mail-ve0-f175.google.com with SMTP id m1so2046181ves.6 for ; Fri, 03 May 2013 21:41:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=BKXhDxAAlnrNz+qkR4tAmvCpZZMS4EEzzUpM2zLjZyY=; b=IjueQ9LHk/PwB8s6GY0NEnaeLPcgC33o/j/D8BpphWmvXRl0gcBT/rd8RE4hJQqdea +OCw6KgBJCEW3kNDgitU9ITWAT8eoMy/AZWk5bzxEM8a6OnqqUXmK6AXOXn4qSTbvp+8 DTJ1zp8fsM5aWLiXvXMaIwacYqVXbfff/U4z9Y7iZg0W5QGLqltv2n719+WRlFAEGfW9 DP02VqESr1tBZwpF3IGBL+HVB5lMofx4aW06C8vNd5Z0bwy2xs6OinScRTeUKvp4oOMI cwt5tYQXcKjUJDzk20Hd9nqmSwqkvVWxlBPUyuSvfspAFX/B218j4M02/dQUdYACf5UT BgeA== MIME-Version: 1.0 X-Received: by 10.52.99.67 with SMTP id eo3mr3927461vdb.21.1367642482953; Fri, 03 May 2013 21:41:22 -0700 (PDT) Received: by 10.220.173.7 with HTTP; Fri, 3 May 2013 21:41:22 -0700 (PDT) In-Reply-To: References: <87zjwuv0qn.fsf@fleche.redhat.com> <87li87ll0r.fsf@fleche.redhat.com> <87fvyd827o.fsf@fleche.redhat.com> Date: Sat, 04 May 2013 04:41:00 -0000 Message-ID: Subject: Re: [PATCH] not trigger pagination with dprintf From: Doug Evans To: Hui Zhu Cc: Tom Tromey , gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnZOKHOWoceAoiV2Sfl833X9eHvpKTZqCoxGoYxoVfCre3gv/Sq3M5iBuICYa9D0Flh+Fl7k9eV+5kssBIIoqSLdz/vyRAnr6g3zSWPy/NScH0C1CN1TYPoQPjDcF4XpuXRbOMmi/h3OAdmyaAmohZdr5PrghYfRBOolgtilNP+Mi5HPFIbwl/NlgdFIlDHuuLhn8yqE7+SXLXaK2XwzciE99rOGQ== X-SW-Source: 2013-05/txt/msg00072.txt.bz2 On Mon, Apr 29, 2013 at 5:57 PM, Hui Zhu wrote: > On Sat, Apr 27, 2013 at 4:30 AM, Tom Tromey wrote: >> Hui> Because as the Marc said in bugzilla, when pagination is triggered, >> Hui> inferior execution will be interrupted until the user answers the >> Hui> pagination prompt. And dptintf breakpoint call printf in its >> Hui> commands. So I want to make dprintf can handle it. >> >> If pagination from a breakpoint's commands really breaks gdb, then it >> should be disabled universally while in "commands", not just for >> dprintf. >> >> If it doesn't break gdb, well, then it seems like it is what the user >> asked for. > > Hi Tom, > > I post a new patch that temporarily set pagination_enabled to 0 in the > begin of commands execution function bpstat_do_actions to close > pagination. > Then all the commands of breakpoint will not trigger pagination. > > If you think this patch is OK, I will update patch for bug 15075 > http://sourceware.org/ml/gdb-patches/2013-04/msg00711.html temporarily > set pagination_enabled to 0 too. > > Thanks, > Hui > > 2013-04-30 Hui Zhu > > PR gdb/15182 > * breakpoint.c (bpstat_do_actions): Temporarily set > pagination_enabled to 0. > > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -4374,7 +4374,11 @@ void > bpstat_do_actions (void) > { > struct cleanup *cleanup_if_error = make_bpstat_clear_actions_cleanup (); > + struct cleanup *back_to; > + extern int pagination_enabled; > > + back_to = make_cleanup_restore_integer (&pagination_enabled); > + pagination_enabled = 0; > /* Do any commands attached to breakpoint we are stopped at. */ > while (!ptid_equal (inferior_ptid, null_ptid) > && target_has_execution > @@ -4387,6 +4391,7 @@ bpstat_do_actions (void) > if (!bpstat_do_actions_1 (&inferior_thread ()->control.stop_bpstat)) > break; > > + do_cleanups (back_to); > discard_cleanups (cleanup_if_error); > } *If* we go this route, then this will require a NEWS item and a doc addition to the breakpoint commands section of the manual to tell users this is happening (and a note saying that any change in pagination done by breakpoint commands is reverted when the commands end). But I wouldn't submit a revised patch until we decide this is what we want to do.