diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 14:58:37 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 14:58:37 -0400 |
commit | 240edef62f0cb5c6cb3dc6da9e35bd8f8af69e01 (patch) | |
tree | 9ca7198bcd8aae2d843b9eaa4599a6cb9cebeb07 /gdb/guile | |
parent | e0d9a2704073d93b413dfa80fbb29f206ecb3762 (diff) | |
download | gdb-240edef62f0cb5c6cb3dc6da9e35bd8f8af69e01.zip gdb-240edef62f0cb5c6cb3dc6da9e35bd8f8af69e01.tar.gz gdb-240edef62f0cb5c6cb3dc6da9e35bd8f8af69e01.tar.bz2 |
gdb: remove iterate_over_breakpoints function
Now that we have range functions that let us use ranged for loops, we
can remove iterate_over_breakpoints in favor of those, which are easier
to read and write. This requires exposing the declaration of
all_breakpoints and all_breakpoints_safe in breakpoint.h, as well as the
supporting types.
Change some users of iterate_over_breakpoints to use all_breakpoints,
when they don't need to delete the breakpoint, and all_breakpoints_safe
otherwise.
gdb/ChangeLog:
* breakpoint.h (iterate_over_breakpoints): Remove. Update
callers to use all_breakpoints or all_breakpoints_safe.
(breakpoint_range, all_breakpoints, breakpoint_safe_range,
all_breakpoints_safe): Move here.
* breakpoint.c (all_breakpoints, all_breakpoints_safe): Make
non-static.
(iterate_over_breakpoints): Remove.
* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
Return void.
* python/py-breakpoint.c (build_bp_list): Add comment, reverse
return value logic.
* guile/scm-breakpoint.c (bpscm_build_bp_list): Return void.
Change-Id: Idde764a1f577de0423e4f2444a7d5cdb01ba5e48
Diffstat (limited to 'gdb/guile')
-rw-r--r-- | gdb/guile/scm-breakpoint.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c index 826dfa9..4ff197e 100644 --- a/gdb/guile/scm-breakpoint.c +++ b/gdb/guile/scm-breakpoint.c @@ -508,7 +508,7 @@ gdbscm_delete_breakpoint_x (SCM self) /* iterate_over_breakpoints function for gdbscm_breakpoints. */ -static bool +static void bpscm_build_bp_list (struct breakpoint *bp, SCM *list) { breakpoint_smob *bp_smob = bp->scm_bp_object; @@ -535,8 +535,6 @@ bpscm_build_bp_list (struct breakpoint *bp, SCM *list) if (bp_smob != NULL) *list = scm_cons (bp_smob->containing_scm, *list); - - return false; } /* (breakpoints) -> list @@ -547,10 +545,8 @@ gdbscm_breakpoints (void) { SCM list = SCM_EOL; - iterate_over_breakpoints ([&] (breakpoint *bp) - { - return bpscm_build_bp_list(bp, &list); - }); + for (breakpoint *bp : all_breakpoints ()) + bpscm_build_bp_list (bp, &list); return scm_reverse_x (list, SCM_EOL); } |