aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-fork.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-04-24 10:21:45 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-04-24 10:21:45 +0000
commit74960c600257a48df8589c16b527ab6f56d1a664 (patch)
tree2a264bfb2395188a5bf167030220fcaf87f6dcb2 /gdb/linux-fork.c
parentd24317b4805503c9a018e77ee4683c87678f11ff (diff)
downloadgdb-74960c600257a48df8589c16b527ab6f56d1a664.zip
gdb-74960c600257a48df8589c16b527ab6f56d1a664.tar.gz
gdb-74960c600257a48df8589c16b527ab6f56d1a664.tar.bz2
* breakpoint.h (bp_location_p): New typedef.
Register a vector of bp_location_p. * breakpoint.c (always_inserted_mode) (show_always_inserted_mode): New. (unlink_locations_from_global_list): Remove. (update_global_location_list) (update_global_location_list_nothrow): New. (update_watchpoint): Don't free locations. (should_insert_location): New. (insert_bp_location): Use should_insert_location. (insert_breakpoint_locations): Copied from insert_breakpoints. (insert_breakpoint): Use insert_breakpoint_locations. (bpstat_stop_status): Call update_global_location_list when disabling breakpoint. (allocate_bp_location): Don't add to bp_location_chain. (set_raw_breakpoint) (create_longjmp_breakpoint, enable_longjmp_breakpoint) (disable_longjmp_breakpoint, create_overlay_event_breakpoint) (enable_overlay_breakpoints, disable_overlay_breakpoints) (set_longjmp_resume_breakpoint) (enable_watchpoints_after_interactive_call_stop) (disable_watchpoints_before_interactive_call_start) (create_internal_breakpoint) (create_fork_vfork_event_catchpoint) (create_exec_event_catchpoint, set_momentary_breakpoint) (create_breakpoints, break_command_1, watch_command_1) (create_exception_catchpoint) (handle_gnu_v3_exceptions) (disable_breakpoint, breakpoint_re_set_one) (create_thread_event_breakpoint, create_solib_event_breakpoint) (create_ada_exception_breakpoint): : Don't call check_duplicates. Call update_global_location_list. (delete_breakpoint): Don't remove locations and don't try to reinsert them. Call update_global_location_list. (update_breakpoint_locations): Likewise. (restore_always_inserted_mode): New. (update_breakpoints_after_exec): Temporary disable always inserted mode. * Makefile.in: Update dependencies. * infrun.c (proceed): Remove breakpoints while stepping over breakpoint. (handle_inferior_event): Don't remove or insert breakpoints. * linux-fork.c (checkpoint_command): Remove breakpoints before fork and insert after. (linux_fork_context): Remove breakpoints before switch and insert after. * target.c (target_disconnect, target_detach): Remove breakpoints from target.
Diffstat (limited to 'gdb/linux-fork.c')
-rw-r--r--gdb/linux-fork.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 8c29827..a9f5fae 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -536,6 +536,10 @@ checkpoint_command (char *args, int from_tty)
/* Make this temp var static, 'cause it's used in the error context. */
static int temp_detach_fork;
+ /* Remove breakpoints, so that they are not inserted
+ in the forked process. */
+ remove_breakpoints ();
+
/* Make the inferior fork, record its (and gdb's) state. */
if (lookup_minimal_symbol ("fork", NULL, NULL) != NULL)
@@ -576,6 +580,7 @@ checkpoint_command (char *args, int from_tty)
if (!fp)
error (_("Failed to find new fork"));
fork_save_infrun_state (fp, 1);
+ insert_breakpoints ();
}
static void
@@ -593,7 +598,9 @@ linux_fork_context (struct fork_info *newfp, int from_tty)
oldfp = add_fork (ptid_get_pid (inferior_ptid));
fork_save_infrun_state (oldfp, 1);
+ remove_breakpoints ();
fork_load_infrun_state (newfp);
+ insert_breakpoints ();
printf_filtered (_("Switching to %s\n"),
target_pid_to_str (inferior_ptid));