This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [7/9] simplify pending breakpoints
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 08 Sep 2007 14:26:36 +0300
- Subject: Re: [7/9] simplify pending breakpoints
- References: <200709080150.05068.vladimir@codesourcery.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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 = ¬_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.