This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Missing breakpoint-modify events
- From: Michael Snyder <msnyder at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 13 Jun 2002 22:34:03 -0700
- Subject: Re: [RFA] Missing breakpoint-modify events
- Organization: Red Hat, Inc.
- References: <Pine.GSO.4.33.0206132154230.19373-100000@makita.cygnus.com>
Keith Seitz wrote:
>
> Hi,
>
> When conditions, commands, and ignore counts are added to an existing
> breakpoint, gdb fails to send an event notification informing UIs of that
> the breakpoint has been modified. This patch fixes this.
Approved. Would that all patches were so easy to review. ;-)
> I've only added event notifications. Are the hooks still needed? (I'm
> operating under the assumption that they are all deprecated and can be
> whacked...)
You would know better than I, I think.
> I've also inserted a little clean up into ignore_command which will only
> print the newline when from_tty is set. This cleans up the MI output when
> -break-after is used.
Hmmm... have you checked whether this affects output from scripts?
I'm thinking --
%> gdb -x myscript >& mylog
>
> ChangeLog
> 2002-06-13 Keith Seitz <keiths@redhat.com>
>
> * breakpoint.c (condition_command): Post breakpoint_modify
> when a condition is added to an existing breakpoint.
> (commands_command): Likewise for commands.
> (set_ignore_count): Likewise for ignore counts.
> If no tty, do not simply return, still need to send event
> notification.
> (ignore_command): Only print a newline if the command came
> from a tty.
> Don't call breakpoints_changed, since this is now properly
> handled by set_ignore_count.
>
> Patch
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.76
> diff -p -r1.76 breakpoint.c
> *** breakpoint.c 10 Jun 2002 23:25:50 -0000 1.76
> --- breakpoint.c 14 Jun 2002 04:49:37 -0000
> *************** condition_command (char *arg, int from_t
> *** 553,558 ****
> --- 553,559 ----
> error ("Junk at end of expression");
> }
> breakpoints_changed ();
> + breakpoint_modify_event (b->number);
> return;
> }
>
> *************** commands_command (char *arg, int from_tt
> *** 592,597 ****
> --- 593,599 ----
> free_command_lines (&b->commands);
> b->commands = l;
> breakpoints_changed ();
> + breakpoint_modify_event (b->number);
> return;
> }
> error ("No breakpoint number %d.", bnum);
> *************** set_ignore_count (int bptnum, int count,
> *** 7071,7088 ****
> if (b->number == bptnum)
> {
> b->ignore_count = count;
> ! if (!from_tty)
> ! return;
> ! else if (count == 0)
> ! printf_filtered ("Will stop next time breakpoint %d is reached.",
> ! bptnum);
> ! else if (count == 1)
> ! printf_filtered ("Will ignore next crossing of breakpoint %d.",
> ! bptnum);
> ! else
> ! printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
> ! count, bptnum);
> breakpoints_changed ();
> return;
> }
>
> --- 7073,7092 ----
> if (b->number == bptnum)
> {
> b->ignore_count = count;
> ! if (from_tty)
> ! {
> ! if (count == 0)
> ! printf_filtered ("Will stop next time breakpoint %d is reached.",
> ! bptnum);
> ! else if (count == 1)
> ! printf_filtered ("Will ignore next crossing of breakpoint %d.",
> ! bptnum);
> ! else
> ! printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
> ! count, bptnum);
> ! }
> breakpoints_changed ();
> + breakpoint_modify_event (b->number);
> return;
> }
>
> *************** ignore_command (char *args, int from_tty
> *** 7119,7126 ****
> set_ignore_count (num,
> longest_to_int (value_as_long (parse_and_eval (p))),
> from_tty);
> ! printf_filtered ("\n");
> ! breakpoints_changed ();
> }
>
> /* Call FUNCTION on each of the breakpoints
> --- 7123,7130 ----
> set_ignore_count (num,
> longest_to_int (value_as_long (parse_and_eval (p))),
> from_tty);
> ! if (from_tty)
> ! printf_filtered ("\n");
> }
>
> /* Call FUNCTION on each of the breakpoints