From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20583 invoked by alias); 14 Jun 2002 05:49:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20570 invoked from network); 14 Jun 2002 05:49:53 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 14 Jun 2002 05:49:53 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id WAA25786; Thu, 13 Jun 2002 22:49:49 -0700 (PDT) Message-ID: <3D09804B.BD4E6526@redhat.com> Date: Thu, 13 Jun 2002 22:49:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Keith Seitz CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] Missing breakpoint-modify events References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-06/txt/msg00242.txt.bz2 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 > > * 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