summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-01-22 20:19:36 +0000
committerPedro Alves <palves@redhat.com>2013-01-22 20:19:36 +0000
commit918df08b8d459c4a44ea3e1e827ea35d334ab1fb (patch)
treed6130d27a3d79a0fa8459b1e9629da20a3da01f3 /gdb/breakpoint.c
parent29705ccdaea812a0ebe4371e6f78689edacdb491 (diff)
downloadgdb-918df08b8d459c4a44ea3e1e827ea35d334ab1fb.tar.gz
All annotate_breakpoints_changed calls are along-side
observer_notify_breakpoints_changed calls. All, except the init_raw_breakpoint one. But that one is actually wrong. The breakpoint is being constructed at that point, and hasn't been placed on the breakpoint chain yet. It would be better placed in install_breakpoint, and I actually started out that way. But once the annotate_breakpoints_changed are parallel to the observer calls, we can fully move annotations to observers too. One issue is that this changes the order of annotations a bit. Before, we'd emit the annotation, and after call "mention()" on the breakpoint (which prints the breakpoint number, etc.). But, we call the observers _after_ mention is called, so the annotation output will change a little: void install_breakpoint (int internal, struct breakpoint *b, int update_gll) { add_to_breakpoint_chain (b); set_breakpoint_number (internal, b); if (is_tracepoint (b)) set_tracepoint_count (breakpoint_count); if (!internal) mention (b); observer_notify_breakpoint_created (b); if (update_gll) update_global_location_list (1); } I believe this order doesn't really matter (the frontend needs to wait for the prompt anyway), so I just adjust the expected output in the tests. Emacs in annotations mode doesn't seem to complain. Couple that with the previous patch that suppressed duplicated annotations, and, the fact that some annotations calls were actually missing (were we do have observer calls), more changes to the tests are needed anyway. Tested on x86_64 Fedora 17. gdb/ 2013-01-22 Pedro Alves <palves@redhat.com> * annotate.c (annotate_breakpoints_changed): Rename to ... (annotate_breakpoints_invalid): ... this. Make static. (breakpoint_changed): Adjust. (_initialize_annotate): Always install the observers. Install a "breakpoint_created" observer. * annotate.h (annotate_breakpoints_changed): Delete declaration. * breakpoint.c (set_breakpoint_condition) (breakpoint_set_commands, do_map_commands_command) (init_raw_breakpoint, clear_command, set_ignore_count) (enable_breakpoint_disp): No longer call annotate_breakpoints_changed. gdb/testsuite/ 2013-01-22 Pedro Alves <palves@redhat.com> * gdb.base/annota1.exp (breakpoints_invalid): New variable. Adjust tests to breakpoints-invalid changes. * gdb.cp/annota2.exp (breakpoints_invalid, frames_invalid): New variables. Adjust tests to breakpoints-invalid changes.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 35848b4a8b3..216ac73c002 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -985,7 +985,6 @@ set_breakpoint_condition (struct breakpoint *b, char *exp,
}
mark_breakpoint_modified (b);
- annotate_breakpoints_changed ();
observer_notify_breakpoint_modified (b);
}
@@ -1217,7 +1216,6 @@ breakpoint_set_commands (struct breakpoint *b,
decref_counted_command_line (&b->commands);
b->commands = alloc_counted_command_line (commands);
- annotate_breakpoints_changed ();
observer_notify_breakpoint_modified (b);
}
@@ -1334,7 +1332,6 @@ do_map_commands_command (struct breakpoint *b, void *data)
incref_counted_command_line (info->cmd);
decref_counted_command_line (&b->commands);
b->commands = info->cmd;
- annotate_breakpoints_changed ();
observer_notify_breakpoint_modified (b);
}
}
@@ -7072,8 +7069,6 @@ init_raw_breakpoint (struct breakpoint *b, struct gdbarch *gdbarch,
program space. */
if (bptype != bp_breakpoint && bptype != bp_hardware_breakpoint)
b->pspace = sal.pspace;
-
- annotate_breakpoints_changed ();
}
/* set_raw_breakpoint is a low level routine for allocating and
@@ -12053,7 +12048,6 @@ clear_command (char *arg, int from_tty)
else
printf_unfiltered (_("Deleted breakpoints "));
}
- annotate_breakpoints_changed ();
for (ix = 0; VEC_iterate(breakpoint_p, found, ix, b); ix++)
{
@@ -14441,7 +14435,6 @@ set_ignore_count (int bptnum, int count, int from_tty)
"crossings of breakpoint %d."),
count, bptnum);
}
- annotate_breakpoints_changed ();
observer_notify_breakpoint_modified (b);
return;
}
@@ -14706,8 +14699,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
bpt->disposition = disposition;
bpt->enable_count = count;
update_global_location_list (1);
- annotate_breakpoints_changed ();
-
+
observer_notify_breakpoint_modified (bpt);
}