From 3ca42dbe77c5d6d5e43e291414b1fa6aac5a0f25 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 28 Sep 2005 23:44:02 +0000 Subject: [PATCH] * annotate.c (breakpoints_changed, annotate_frames_invalid) (_initialize_annotate): Print breakpoints-invalid and frames-invalid for level 2 annotations only. * gdb.base/annota3.exp, gdb.cp/annota3.exp: The annotations frames-invalid and breakpoints-invalid are no longer generated with level 3 so don't expect them in the output. --- gdb/annotate.c | 6 +++--- gdb/testsuite/gdb.base/annota3.exp | 20 +++----------------- gdb/testsuite/gdb.cp/annota3.exp | 13 ++----------- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/gdb/annotate.c b/gdb/annotate.c index 205fe89dd35..6242b7496db 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -55,7 +55,7 @@ print_value_flags (struct type *t) void breakpoints_changed (void) { - if (annotation_level > 1) + if (annotation_level == 2) { target_terminal_ours (); printf_unfiltered (("\n\032\032breakpoints-invalid\n")); @@ -228,7 +228,7 @@ annotate_breakpoints_table_end (void) void annotate_frames_invalid (void) { - if (annotation_level > 1) + if (annotation_level == 2) { target_terminal_ours (); printf_unfiltered (("\n\032\032frames-invalid\n")); @@ -577,7 +577,7 @@ breakpoint_changed (struct breakpoint *b) void _initialize_annotate (void) { - if (annotation_level > 1) + if (annotation_level == 2) { deprecated_delete_breakpoint_hook = breakpoint_changed; deprecated_modify_breakpoint_hook = breakpoint_changed; diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp index ccc16e2bcaf..10eed26852a 100644 --- a/gdb/testsuite/gdb.base/annota3.exp +++ b/gdb/testsuite/gdb.base/annota3.exp @@ -118,9 +118,7 @@ send_gdb "run\n" gdb_expect_list "run until main breakpoint" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "Starting program: .*annota3 \r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032starting\r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032breakpoint 1\r\n" "\r\n" "Breakpoint 1, main \\(\\) at .*annota3.c:32\r\n" @@ -139,7 +137,6 @@ send_gdb "next\n" gdb_expect_list "go after array init line" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "\r\n\032\032starting\r\n" - "\(\r\n\032\032frames-invalid\r\n\)+" "\r\n\032\032source .*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n" "\r\n\032\032stopped\r\n" } @@ -177,7 +174,6 @@ gdb_expect_list "print non_existent_value" "$gdb_prompt$" { send_gdb "break handle_USR1\n" gdb_expect_list "breakpoint handle_USR1" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" "Breakpoint.*at 0x\[0-9a-z\]+: file.*annota3.c, line.*\r\n" } @@ -187,7 +183,6 @@ gdb_expect_list "breakpoint handle_USR1" "$gdb_prompt$" { send_gdb "break printf\n" gdb_expect_list "breakpoint printf" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" "Breakpoint.*at 0x\[0-9a-z\]+.*" } @@ -199,7 +194,6 @@ gdb_expect_list "continue to printf" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "Continuing.\r\n" "\r\n\032\032starting\r\n" - "\r\n\032\032frames-invalid\r\n" "\r\n\032\032breakpoint 3\r\n" "\r\n" "Breakpoint 3, \[^\r\n\]*\r\n" @@ -227,7 +221,6 @@ if [target_info exists gdb,nosignals] { "\r\n\032\032post-prompt\r\n" "Continuing with signal SIGUSR1.\r\n" "\r\n\032\032starting\r\n" - "\r\n\032\032frames-invalid\r\n" "\r\n\032\032breakpoint 2\r\n" "Breakpoint 2, handle_USR1 \\(sig=\[0-9\]+\\) at .*annota3.c:\[0-9\]+\r\n" "\r\n\032\032source .*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n" @@ -277,7 +270,6 @@ gdb_expect_list "delete bp 3" "$gdb_prompt$" { send_gdb "break main\n" gdb_expect_list "break at 28" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" "Breakpoint 4 at 0x\[0-9a-z\]+: file .*annota3.c, line 32.\r\n" } @@ -312,11 +304,12 @@ gdb_expect { # # Test that breakpoints-invalid is issued once and only once for # breakpoint ignore count changes, after annotation stopped. -# +# NOTE: breakpoints-invalid annotations have been removed from +# level 3 but keep these tests for continuity and comparison +# with annota1.exp. send_gdb "break 46\n" gdb_expect_list "break at 46" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" "Breakpoint 5 at 0x\[0-9a-z\]+: file .*annota3.c, line 46.\r\n" } @@ -324,20 +317,17 @@ send_gdb "ignore 5 4\n" gdb_expect_list "ignore 5 4" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "Will ignore next 4 crossings of breakpoint 5" - "\r\n\032\032breakpoints-invalid\r\n" "\r\n" } send_gdb "continue\n" gdb_expect_list "annotate ignore count change" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\(\r\n\032\032frames-invalid\r\n\)+" "\r\n\032\032breakpoint 5\r\n" "Breakpoint 5, main \\(\\) at .*annota3.c:46\r\n" "\r\n\032\032source .*annota3.c:46:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n" "1: value = 11\r\n" "\r\n\032\032stopped\r\n" - "\r\n\032\032breakpoints-invalid\r\n" } # check that ignore command is working, or the above can provide @@ -347,7 +337,6 @@ send_gdb "next\n" gdb_expect_list "next to exit loop" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "\r\n\032\032starting\r\n" - "\(\r\n\032\032frames-invalid\r\n\)+" "\r\n\032\032source.*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n" "1: value = 12\r\n" "\r\n\032\032stopped\r\n" @@ -357,7 +346,6 @@ send_gdb "next\n" gdb_expect_list "breakpoint ignore count" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "\r\n\032\032starting\r\n" - "\(\r\n\032\032frames-invalid\r\n\)+" "\r\n\032\032source.*annota3.c:49:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n" "1: value = 12\r\n" "\r\n\032\032stopped\r\n" @@ -384,8 +372,6 @@ if [target_info exists gdb,nosignals] { "\r\n\032\032post-prompt\r\n" "Continuing with signal SIGTRAP.\r\n" "\r\n\032\032starting\r\n" - "\r\n\032\032frames-invalid\r\n" - "\r\n\032\032frames-invalid\r\n" "\r\n\032\032signalled\r\n" "\r\nProgram terminated with signal SIGTRAP, Trace.breakpoint trap.\r\n" "The program no longer exists.\r\n" diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp index 37be48d9b39..edee7f2f313 100644 --- a/gdb/testsuite/gdb.cp/annota3.exp +++ b/gdb/testsuite/gdb.cp/annota3.exp @@ -93,9 +93,7 @@ send_gdb "run\n" gdb_expect_list "first run until main breakpoint" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "Starting program: .*annota3 \r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032starting\r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032breakpoint 1\r\n" "\r\n" "Breakpoint 1, main \\(\\) at .*annota3.cc:25\r\n" @@ -122,13 +120,10 @@ gdb_expect_list "continue to exit" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" "Continuing.\r\n" "\r\n\032\032starting\r\n" - "\r\n\032\032frames-invalid\r\n" "a.x is 1\r\n" - "\r\n\032\032frames-invalid\r\n" "\r\n\032\032exited 0\r\n" "\r\n" "Program exited normally.\r\n" - "\r\n\032\032frames-invalid\r\n" "\r\n\032\032stopped\r\n" } @@ -155,7 +150,6 @@ gdb_expect { send_gdb "break 22\n" gdb_expect_list "break at main" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" "Breakpoint.*at 0x\[a-z0-9\]+: file.*annota3.cc, line 22.\r\n" } @@ -167,9 +161,7 @@ gdb_expect_list "break at main" "$gdb_prompt$" { send_gdb "run\n" gdb_expect_list "second run until main breakpoint" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032starting\r\n" - "\(\r\n\032\032\(frames-invalid|breakpoints-invalid\)\r\n\)+" "\r\n\032\032breakpoint 2\r\n" "\r\n" "Breakpoint 2, main \\(\\) at .*annota3.cc:22\r\n" @@ -183,7 +175,6 @@ gdb_expect_list "second run until main breakpoint" "$gdb_prompt$" { send_gdb "watch a.x\n" gdb_expect_list "set watch on a.x" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" - "\r\n\032\032breakpoints-invalid\r\n" ".*atchpoint 3: a.x\r\n" \ } @@ -193,10 +184,10 @@ gdb_expect_list "set watch on a.x" "$gdb_prompt$" { # send_gdb "next\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\(\r\n\032\032frames-invalid\r\n\)+\r\n\032\032watchpoint 3\r\n.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\nmain \\(\\) at .*$srcfile:$decimal\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032watchpoint 3\r\n.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\nmain \\(\\) at .*$srcfile:$decimal\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" { pass "watch triggered on a.x" } - -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032stopped\r\n$gdb_prompt$" { + -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032stopped\r\n$gdb_prompt$" { kfail "gdb/38" "watch triggered on a.x" } -re ".*$gdb_prompt$" { -- 2.30.2