From ce78b96d4f550fd3e28d31ffa74208f609bfa344 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 16 Oct 2008 16:25:04 +0000 Subject: * breakpoint.h (enum bptype): New enum bp_catchpoint. Delete bp_catch_fork and bp_catch_vfork. (struct breakpoint_ops): Add new methods "insert", "remove" and "breakpoint_hit". * breakpoint.c (create_fork_vfork_event_catchpoint) (create_fork_event_catchpoint, create_vfork_event_catchpoint): Remove. (insert_catchpoint): Remove handling of bp_catch_fork and bp_catch_vfork catchpoints, and handle them as bp_catchpoint catchpoints instead. (insert_bp_location, update_breakpoints_after_exec) (remove_breakpoint, bpstat_check_location, bpstat_what) (allocate_bp_location): Likewise. (print_it_typical, print_one_breakpoint_location, mention): Remove handling of bp_catch_fork and bp_catch_vfork breakpoints. (ep_is_catchpoint, user_settable_breakpoint) (breakpoint_address_is_meaningful, adjust_breakpoint_address) (breakpoint_re_set_one, disable_command, enable_command): Remove use of bp_catch_fork and bp_catch_vfork. Add handling of bp_catchpoint breakpoints. (insert_catch_fork, remove_catch_fork, breakpoint_hit_catch_fork) (print_it_catch_fork, print_one_catch_fork, print_mention_catch_fork): New functions. (catch_fork_breakpoint_ops): New static constant. (insert_catch_vfork, remove_catch_vfork, breakpoint_hit_catch_vfork) (print_it_catch_vfork, print_one_catch_vfork) (print_mention_catch_vfork): New functions. (catch_vfork_breakpoint_ops): New static constant. (create_catchpoint, create_fork_vfork_event_catchpoint): New functions. (catch_fork_command_1): Use create_fork_vfork_event_catchpoint to create the fork and vfork catchpoints. (gnu_v3_exception_catchpoint_ops): Set new breakpoint_ops fields. * ada-lang.c (catch_exception_breakpoint_ops): Set new breakpoint_ops fields. (catch_exception_unhandled_breakpoint_ops): Likewise. (catch_assert_breakpoint_ops): Likewise. --- gdb/breakpoint.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gdb/breakpoint.h') diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 65f5ae1..0e1aa0e 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -110,6 +110,8 @@ enum bptype bp_overlay_event, + bp_catchpoint, + /* These breakpoints are used to implement the "catch load" command on platforms whose dynamic linkers support such functionality. */ bp_catch_load, @@ -124,8 +126,6 @@ enum bptype kernels which can raise an event when a fork or exec occurs, as opposed to the debugger setting breakpoints on functions named "fork" or "exec".) */ - bp_catch_fork, - bp_catch_vfork, bp_catch_exec, }; @@ -315,6 +315,19 @@ struct bp_location struct breakpoint_ops { + /* Insert the breakpoint or activate the catchpoint. Should raise + an exception if the operation failed. */ + void (*insert) (struct breakpoint *); + + /* Remove the breakpoint/catchpoint that was previously inserted + with the "insert" method above. Return non-zero if the operation + succeeded. */ + int (*remove) (struct breakpoint *); + + /* Return non-zero if the debugger should tell the user that this + breakpoint was hit. */ + int (*breakpoint_hit) (struct breakpoint *); + /* The normal print routine for this breakpoint, called when we hit it. */ enum print_stop_action (*print_it) (struct breakpoint *); -- cgit v1.1