From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16043 invoked by alias); 8 Sep 2007 11:26:44 -0000 Received: (qmail 16035 invoked by uid 22791); 8 Sep 2007 11:26:43 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (213.8.233.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 08 Sep 2007 11:26:38 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-141-251.inter.net.il [80.230.141.251]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id HTC93797 (AUTH halo1); Sat, 8 Sep 2007 14:23:51 +0300 (IDT) Date: Sat, 08 Sep 2007 11:26:00 -0000 Message-Id: From: Eli Zaretskii To: Vladimir Prus CC: gdb-patches@sources.redhat.com In-reply-to: <200709080150.05068.vladimir@codesourcery.com> (message from Vladimir Prus on Sat, 8 Sep 2007 01:50:04 +0400) Subject: Re: [7/9] simplify pending breakpoints Reply-to: Eli Zaretskii References: <200709080150.05068.vladimir@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2007-09/txt/msg00108.txt.bz2 > From: Vladimir Prus > Date: Sat, 8 Sep 2007 01:50:04 +0400 > > @@ -5422,12 +5355,9 @@ break_command_1 (char *arg, int flag, in > } > else > { > - struct symtab_and_line sal; > + struct symtab_and_line sal = {}; Is this a valid initializer in ISO C? I think it isn't; at least under -pedantic, GCC says: ttt.c: In function `foo': ttt.c:6: warning: ISO C forbids empty initializer braces > +static void > +unlink_locations_from_global_list (struct breakpoint *bpt) > + /* Remove locations of this breakpoint from the list of > + all breakpoint locations. */ > +{ Style: I think GNU coding standards discourage comments between the function's definition line and the opening braces. > +static void > +update_breakpoint_location (struct breakpoint *b, > + struct symtabs_and_lines sals) > +{ > + int i; > + char *s; > + /* FIXME: memleak. */ Is there a memory leak here? > @@ -7164,11 +7185,13 @@ breakpoint_re_set_one (void *bint) > struct breakpoint *b = (struct breakpoint *) bint; > struct value *mark; > int i; > - int not_found; > - int *not_found_ptr = NULL; > - struct symtabs_and_lines sals; > + int not_found = 0; > + int *not_found_ptr = ¬_found; > + struct symtabs_and_lines sals = {}; See above. > - breakpoints_changed (); > + /* We surely don't want to warn about the same breakpoint > + 10 times. Why not? They are different breakpoints.