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


> 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

> +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 = &not_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.


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