[PATCH] breakpoint always inserted in record target

Doug Evans dje@google.com
Thu Apr 12 05:16:00 GMT 2012


On Wed, Apr 11, 2012 at 6:06 AM, Yao Qi <yao@codesourcery.com> wrote:
> 2012-04-11  Yao Qi  <yao@codesourcery.com>
>
>        * breakpoint.c (iterate_over_bp_locations): New.
>        * breakpoint.h: Declare.
>        * record.c (record_open): Call record_init_record_breakpoints.
>        (record_sync_record_breakpoints): New.
>        (record_init_record_breakpoints): New.
> ---
>  gdb/breakpoint.c |   13 +++++++++++++
>  gdb/breakpoint.h |    2 ++
>  gdb/record.c     |   30 ++++++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index be536bc..c5109d6 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -2425,6 +2425,19 @@ insert_breakpoints (void)
>     insert_breakpoint_locations ();
>  }
>
> +/* Invoke CALLBACK for each of bp_location.  */
> +
> +void
> +iterate_over_bp_locations (void (*callback) (struct bp_location *))
> +{
> +  struct bp_location *loc, **loc_tmp;
> +
> +  ALL_BP_LOCATIONS (loc, loc_tmp)
> +    {
> +      callback (loc);
> +    }
> +}

Hi.
Nit: Functions that take callbacks generally also take a void* to pass
to the callback.

Plus, can you write a testcase?



More information about the Gdb-patches mailing list