diff options
author | Pedro Alves <palves@redhat.com> | 2013-01-22 20:19:40 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-01-22 20:19:40 +0000 |
commit | 9c97429fb1870f53e69556e967d01ce01116b35e (patch) | |
tree | 15efcb9b83fb956edfffec9d50002abb91811e87 /gdb/testsuite/gdb.base/annota1.exp | |
parent | bd00c69423eff0d06f1632cfb50ccb5d8ab58151 (diff) | |
download | gdb-9c97429fb1870f53e69556e967d01ce01116b35e.zip gdb-9c97429fb1870f53e69556e967d01ce01116b35e.tar.gz gdb-9c97429fb1870f53e69556e967d01ce01116b35e.tar.bz2 |
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/testsuite/gdb.base/annota1.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/annota1.exp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index 776738a..45638ba 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -25,6 +25,7 @@ if [is_remote target] then { return 0 } +set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n" # # test running programs @@ -190,7 +191,7 @@ gdb_test_multiple "print non_existent_value" "print non_existent_value" { # we can test annotate-signal-handler-caller # gdb_test_multiple "break handle_USR1" "break handle_USR1" { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n\032\032breakpoints-invalid\r\n.*$gdb_prompt$" { pass "break handle_USR1" } } @@ -199,7 +200,7 @@ gdb_test_multiple "break handle_USR1" "break handle_USR1" { # break at printf. When we are stopped at printf, we can test # gdb_test_multiple "break printf" "break printf" { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex.*$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex.*\032\032breakpoints-invalid\r\n.*$gdb_prompt$" { pass "break printf" } -re "\r\n\032\032post-prompt\r\nwarning: Breakpoint address adjusted from $hex to $hex.\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex.*$gdb_prompt$" { @@ -210,7 +211,7 @@ gdb_test_multiple "break printf" "break printf" { # # get to printf # -set pat_begin "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n" +set pat_begin "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n${breakpoints_invalid}" set pat_adjust "warning: Breakpoint 3 address previously adjusted from $hex to $hex.\r\n" set pat_end "\r\n\032\032breakpoint 3\r\n\r\nBreakpoint 3, \r\n\032\032frame-begin 0 $hex\r\n\r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*.*\032\032frame-function-name\r\n.*printf(@.*)?\r\n\032\032frame-args\r\n.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" @@ -279,19 +280,19 @@ if [target_info exists gdb,nosignals] { # delete all the breakpoints # gdb_test_multiple "delete 1" "delete bp 1" { - -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" { pass "delete bp 1" } } gdb_test_multiple "delete 2" "delete bp 2" { - -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" { pass "delete bp 2" } } gdb_test_multiple "delete 3" "delete bp 3" { - -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" { pass "delete bp 3" } } @@ -301,10 +302,10 @@ gdb_test_multiple "delete 3" "delete bp 3" { # to test the annotate output for the display command. # gdb_test_multiple "break main" "break at main" { - -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file ${escapedsrcfile}, line $main_line.*$gdb_prompt$" { + -re "post-prompt.*Breakpoint 4 at $hex: file ${escapedsrcfile}, line $main_line.*\032\032breakpoints-invalid.*$gdb_prompt$" { pass "break at main" } - -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file .*${srcfile}, line $main_line.*$gdb_prompt$" { + -re "post-prompt.*Breakpoint 4 at $hex: file .*${srcfile}, line $main_line.*\032\032breakpoints-invalid.*$gdb_prompt$" { setup_xfail "*-*-*" 1270 fail "break at main" } @@ -424,7 +425,7 @@ if [target_info exists gdb,nosignals] { } else { setup_xfail hppa*-*-hpux11* gdb_test_multiple "signal SIGTRAP" "signal sent" { - -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" { + -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n${breakpoints_invalid}\r\n\032\032stopped\r\n$gdb_prompt$" { pass "signal sent" } } |