aboutsummaryrefslogtreecommitdiff
path: root/gdb/dummy-frame.c
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-10-09 13:50:20 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-10-15 15:29:55 +0200
commit95da600f404ca159242f49441d9b4ea78183852b (patch)
treee72c73cbdad57163586abb1c6ead09661d0fbb96 /gdb/dummy-frame.c
parent9b142ddb4a115b6e58fabb05920bdd94811fda98 (diff)
downloadfsf-binutils-gdb-95da600f404ca159242f49441d9b4ea78183852b.zip
fsf-binutils-gdb-95da600f404ca159242f49441d9b4ea78183852b.tar.gz
fsf-binutils-gdb-95da600f404ca159242f49441d9b4ea78183852b.tar.bz2
Change iterate_over_breakpoints to take a function_view
This allows callers to pass in capturing lambdas. Also changes the return type to bool. gdb/ChangeLog: 2019-10-15 Christian Biesinger <cbiesinger@google.com> * breakpoint.c (iterate_over_breakpoints): Change function pointer to a gdb::function_view and return value to bool. * breakpoint.h (iterate_over_breakpoints): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Update. (pop_dummy_frame): Update. * guile/scm-breakpoint.c (bpscm_build_bp_list): Update. (gdbscm_breakpoints): Update. * python/py-breakpoint.c (build_bp_list): Update. (gdbpy_breakpoints): Update. * python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb): Update. (bpfinishpy_handle_stop): Update. (bpfinishpy_handle_exit): Update. * solib-svr4.c (svr4_update_solib_event_breakpoint): Update. (svr4_update_solib_event_breakpoints): Update. Change-Id: Ia9de4deecae562a70a40f5cd49f5a74d64570251
Diffstat (limited to 'gdb/dummy-frame.c')
-rw-r--r--gdb/dummy-frame.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index d3ede7c..3b76d45 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -126,11 +126,9 @@ remove_dummy_frame (struct dummy_frame **dummy_ptr)
/* Delete any breakpoint B which is a momentary breakpoint for return from
inferior call matching DUMMY_VOIDP. */
-static int
-pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
+static bool
+pop_dummy_frame_bpt (struct breakpoint *b, struct dummy_frame *dummy)
{
- struct dummy_frame *dummy = (struct dummy_frame *) dummy_voidp;
-
if (b->thread == dummy->id.thread->global_num
&& b->disposition == disp_del && frame_id_eq (b->frame_id, dummy->id.id))
{
@@ -140,11 +138,11 @@ pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
delete_breakpoint (b);
/* Stop the traversal. */
- return 1;
+ return true;
}
/* Continue the traversal. */
- return 0;
+ return false;
}
/* Pop *DUMMY_PTR, restoring program state to that before the
@@ -168,7 +166,10 @@ pop_dummy_frame (struct dummy_frame **dummy_ptr)
restore_infcall_suspend_state (dummy->caller_state);
- iterate_over_breakpoints (pop_dummy_frame_bpt, dummy);
+ iterate_over_breakpoints ([dummy] (breakpoint* bp)
+ {
+ return pop_dummy_frame_bpt (bp, dummy);
+ });
/* restore_infcall_control_state frees inf_state,
all that remains is to pop *dummy_ptr. */