Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Doug Evans <dje@google.com>
Cc: Tom Tromey <tromey@redhat.com>,
	gdb-patches ml <gdb-patches@sourceware.org>,
		Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH] not trigger pagination with dprintf
Date: Tue, 07 May 2013 02:30:00 -0000	[thread overview]
Message-ID: <CANFwon3HJye8SdLL8jV8H7-g-BipNON6+oS2p8J=QpnnrXbdFA@mail.gmail.com> (raw)
In-Reply-To: <CADPb22Qz2tBWQmis=VbgXexNnYiqos2A1pBgeNN_NZtdQ=VtuQ@mail.gmail.com>

On Sat, May 4, 2013 at 12:41 PM, Doug Evans <dje@google.com> wrote:
> 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.

Hi Doug,

Thanks for your remind.

I post new patches include patch for doc.

Thanks,
Hui

2013-05-07  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15182
	* breakpoint.c (bpstat_do_actions): Temporarily set
	pagination_enabled to 0.

2013-05-07  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15182
	* gdb.texinfo (Breakpoint Command Lists): Add introduce about auto
	set pagination off.

--- 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);
 }



--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -51,6 +51,9 @@ show remote trace-status-packet
   ** The -trace-save MI command can optionally save trace buffer in Common
      Trace Format now.

+* When GDB executes the commands of any breakpoint, the GDB output
+  pagination will be auto set to off.
+
 *** Changes in GDB 7.6

 * Target record has been renamed to record-full.
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -4619,6 +4619,9 @@ commands to execute when your program st
 example, you might want to print the values of certain expressions, or
 enable other breakpoints.

+When @value{GDBN} executes the commands of any breakpoint,
+the @value{GDBN} output pagination will be auto set to off.
+
 @table @code
 @kindex commands
 @kindex end@r{ (breakpoint commands)}


  reply	other threads:[~2013-05-07  2:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  3:22 Hui Zhu
2013-04-20  8:20 ` Tom Tromey
2013-04-22  9:21   ` Hui Zhu
2013-04-25  8:02     ` Tom Tromey
2013-04-26 13:55       ` Hui Zhu
2013-04-26 14:14         ` Yao Qi
2013-04-27 11:40         ` Tom Tromey
2013-04-30 11:12           ` Hui Zhu
2013-05-04  4:41             ` Doug Evans
2013-05-07  2:30               ` Hui Zhu [this message]
2013-05-07 16:39                 ` Eli Zaretskii
2013-05-07 17:01                   ` Doug Evans
2013-05-07 18:08                     ` Tom Tromey
2013-05-07 18:10                       ` Doug Evans
2013-05-07 18:28                         ` Eli Zaretskii
2013-05-10 11:21                           ` Hui Zhu

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='CANFwon3HJye8SdLL8jV8H7-g-BipNON6+oS2p8J=QpnnrXbdFA@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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