This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] not trigger pagination with dprintf
- From: Doug Evans <dje at google dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 3 May 2013 21:41:22 -0700
- Subject: Re: [PATCH] not trigger pagination with dprintf
- References: <CANFwon2V2vVADH89czoQjS+F=Uxsc5AgMAsQ3=d0nohc2EfBpA at mail dot gmail dot com> <87zjwuv0qn dot fsf at fleche dot redhat dot com> <CANFwon1kWpR9mhGVbzf0qB4GqO89yN+Uj9jGUHpp2-kWWmFC4g at mail dot gmail dot com> <87li87ll0r dot fsf at fleche dot redhat dot com> <CANFwon2jNppHObCEac=aSU6Uq6KLaoC5PGS8Vi3LawA+xzOJ=A at mail dot gmail dot com> <87fvyd827o dot fsf at fleche dot redhat dot com> <CANFwon1m=hRBz22GLGa_CpWCYZ874K1P7mCEyYXHVc4T84U17A at mail dot gmail dot com>
On Mon, Apr 29, 2013 at 5:57 PM, Hui Zhu <teawater@gmail.com> wrote:
> On Sat, Apr 27, 2013 at 4:30 AM, Tom Tromey <tromey@redhat.com> 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 <hui@codesourcery.com>
>
> 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.