This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [7/9] simplify pending breakpoints


On Saturday 08 September 2007 15:26:36 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]