- Fix hardware watchpoints after inferior forks-off some process.

This commit is contained in:
Jan Kratochvil 2007-10-14 20:11:42 +00:00
commit 9a1b9888ac
3 changed files with 334 additions and 1 deletions

View file

@ -1244,3 +1244,45 @@ https://bugzilla.redhat.com/show_bug.cgi?id=328021
return TD_NOTHR;
/* Note the cast through uintptr_t: this interface only works if
http://sources.redhat.com/ml/gdb-patches/2007-07/msg00034.html
2007-07-02 Daniel Jacobowitz <dan@codesourcery.com>
* breakpoint.c (reattach_breakpoints): Do not use remove_breakpoint.
Call insert_bp_location.
[ Backported. ]
--- gdb-6.6/gdb/breakpoint.c.orig 2007-10-14 17:42:36.000000000 +0200
+++ gdb-6.6/gdb/breakpoint.c 2007-10-14 17:45:57.000000000 +0200
@@ -1313,20 +1313,19 @@
struct bp_location *b;
int val;
struct cleanup *old_chain = save_inferior_ptid ();
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ int dummy1 = 0, dummy2 = 0, dummy3 = 0;
+
+ make_cleanup_ui_file_delete (tmp_error_stream);
- /* Set inferior_ptid; remove_breakpoint uses this global. */
inferior_ptid = pid_to_ptid (pid);
ALL_BP_LOCATIONS (b)
{
if (b->inserted)
{
- remove_breakpoint (b, mark_inserted);
- if (b->loc_type == bp_loc_hardware_breakpoint)
- val = target_insert_hw_breakpoint (&b->target_info);
- else
- val = target_insert_breakpoint (&b->target_info);
- /* FIXME drow/2003-10-07: This doesn't handle any other kinds of
- breakpoints. It's wrong for watchpoints, for example. */
+ b->inserted = 0;
+ val = insert_bp_location (b, tmp_error_stream,
+ &dummy1, &dummy2, &dummy3);
if (val != 0)
{
do_cleanups (old_chain);