From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21311 invoked by alias); 8 Sep 2007 11:43:59 -0000 Received: (qmail 21303 invoked by uid 22791); 8 Sep 2007 11:43:58 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 08 Sep 2007 11:43:54 +0000 Received: (qmail 466 invoked from network); 8 Sep 2007 11:43:52 -0000 Received: from unknown (HELO h38.net64.aknet.ru) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Sep 2007 11:43:52 -0000 From: Vladimir Prus To: Eli Zaretskii Subject: Re: [7/9] simplify pending breakpoints Date: Sat, 08 Sep 2007 11:43:00 -0000 User-Agent: KMail/1.9.6 References: <200709080150.05068.vladimir@codesourcery.com> In-Reply-To: Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709081543.45598.vladimir@codesourcery.com> 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/msg00110.txt.bz2 On Saturday 08 September 2007 15:26:36 Eli Zaretskii wrote: > > 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 Ehm. Then do I have to resort to 'memset' to initialize it? > > +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. Will fix. > > +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? No, the comment is state. The memleak used to be there before, and is fixed by this code at the end of the function: + if (existing) + free_bp_location (existing); I'll remove the comment. > > - breakpoints_changed (); > > + /* We surely don't want to warn about the same breakpoint > > + 10 times. > > Why not? They are different breakpoints. What are "they"? Say you've set a breakpoint. The you've changed the program and restarted it, so that breakpoint is not longer valid. I do expect an error to be printed, but I don't expect that error to be printed each time a new shared library is loaded. - Volodya