* Re: [patch] fix for PR2424 @ 2008-04-15 15:31 Aleksandar Ristovski 0 siblings, 0 replies; 23+ messages in thread From: Aleksandar Ristovski @ 2008-04-15 15:31 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: Vladimir Prus, gdb-patches, nickrob [-- Attachment #1: Type: text/plain, Size: 2233 bytes --] Daniel Jacobowitz wrote: > On Tue, Apr 15, 2008 at 10:43:47AM -0400, Aleksandar Ristovski wrote: >> NOTE2: Due to quite significant rework of certain functions in >> mi-support.exp, >> committed diff for testsuite is not exactly the same as the one I posted. I >> took >> liberty to commit anyway since the changes are functionally the same; note >> the >> slightly awkward syntax for "mi_expect_stop" call, namely the "extra" >> argument >> which now must be something like { "" "disp=\"keep\"" } - I don't think it's >> too >> bad (it can be beautified later). > > Committing anyway is fine. When you commit a modified version of a > patch, though, please post the final version for the list archives. > Thanks. That way anyone whose code is affected can see the changes. > For the record, posting the final diff for testsuite. 2008-04-15 Aleksandar Ristovski <aristovski@qnx.com> * gdb.base/attach.exp (do_attach_tests): Matching pattern for temporary breakpoint to match "Temporary breakpoint". * gdb.base/break.exp (delete_breakpoints): Likewise. * gdb.base/call-ar-st.exp (get_debug_format): Likewise. * gdb.base/commands.exp (temporary_breakpoint_commands): Likewise. * gdb.base/display.exp: Likewise. * gdb.base/foll-exec.exp (do_exec_tests): Likewise. * gdb.base/foll-fork.exp (catch_fork_child_follow): Likewise. * gdb.base/restore.exp (restore_tests): Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/watchpoint.exp: Likewise. * gdb.mi/mi-cli.exp: Added argument for new "disp" field. * gdb.mi/mi-pending.exp: Likewise. * gdb.mi/mi-simplerun.exp (test_running_the_program): Likewise. * gdb.mi/mi-until.exp (test_runnint_to_foo): Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-simplerun.exp (test_running_the_program): Likewise. * gdb.mi/mi2-until.exp (test_running_to_foo): Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * lib/gdb.exp (gdb_breakpoint): Pattern for temporary breakpoint. * lib/mi-support.exp (mi_runto_helper): Use "after_reason" argument for new "disp" field. (mi_expect_stop): Move after_reason argument to be really after reason. This is to support fix for PR2424. [-- Attachment #2: PR2424testsuite.diff --] [-- Type: text/plain, Size: 29269 bytes --] Index: gdb.base/attach.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/attach.exp,v retrieving revision 1.22 diff -u -p -r1.22 attach.exp --- gdb.base/attach.exp 1 Jan 2008 22:53:18 -0000 1.22 +++ gdb.base/attach.exp 15 Apr 2008 14:24:43 -0000 @@ -238,7 +238,7 @@ proc do_attach_tests {} { send_gdb "tbreak 19\n" gdb_expect { - -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { + -re "Temporary breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { pass "after attach2, set tbreak postloop" } -re "$gdb_prompt $" { Index: gdb.base/break.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v retrieving revision 1.35 diff -u -p -r1.35 break.exp --- gdb.base/break.exp 7 Apr 2008 16:32:44 -0000 1.35 +++ gdb.base/break.exp 15 Apr 2008 14:24:43 -0000 @@ -234,13 +234,13 @@ delete_breakpoints # test temporary breakpoint at function # -gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" +gdb_test "tbreak main" "Temporary breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" # # test break at function in file # -gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ +gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$srcfile, line.*" \ "Temporary breakpoint function in file" # @@ -248,7 +248,7 @@ gdb_test "tbreak $srcfile:factorial" "Br # send_gdb "tbreak $bp_location1\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } -re ".*$gdb_prompt $" { @@ -259,14 +259,14 @@ gdb_expect { } } -gdb_test "tbreak $bp_location6" "Breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" +gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" # # test break at line number in file # send_gdb "tbreak $srcfile:$bp_location2\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } -re ".*$gdb_prompt $" { @@ -278,7 +278,7 @@ gdb_expect { } set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] -gdb_test "tbreak $srcfile:$bp_location11" "Breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" +gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" # # check to see what breakpoints are set (temporary this time) Index: gdb.base/call-ar-st.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-ar-st.exp,v retrieving revision 1.18 diff -u -p -r1.18 call-ar-st.exp --- gdb.base/call-ar-st.exp 1 Jan 2008 22:53:18 -0000 1.18 +++ gdb.base/call-ar-st.exp 15 Apr 2008 14:24:43 -0000 @@ -109,7 +109,7 @@ get_debug_format #go -until 1209 gdb_test "tbreak 1209" \ - "Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \ + "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \ "tbreakpoint line 1209" gdb_test continue \ @@ -149,7 +149,7 @@ if ![gdb_skip_stdio_test "print_char_arr #go -until 1216 gdb_test "tbreak 1216" \ -"Breakpoint.*file.*$srcfile, line 1216.*" \ +"Temporary breakpoint.*file.*$srcfile, line 1216.*" \ "tbreakpoint line 1216" if ![gdb_skip_stdio_test "continue to 1216"] { @@ -183,7 +183,7 @@ if ![gdb_skip_stdio_test "continue to 12 #set timeout $oldtimeout #go -until 1220 gdb_test "tbreak 1220" \ - "Breakpoint.* file .*$srcfile, line 1220.*" \ + "Temporary breakpoint.* file .*$srcfile, line 1220.*" \ "tbreakpoint line 1220" if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \ @@ -247,7 +247,7 @@ if {![gdb_skip_float_test "print print_d #go -until 1236 gdb_test "tbreak 1236" \ -"Breakpoint.* file .*$srcfile, line 1236.*" \ +"Temporary breakpoint.* file .*$srcfile, line 1236.*" \ "tbreakpoint line 1236" if {![gdb_skip_float_test "continuing to 1236"] && \ @@ -311,7 +311,7 @@ if ![gdb_skip_stdio_test "print print_ar #go -until 1241 gdb_test "tbreak 1241" \ - "Breakpoint..* file .*$srcfile, line 1241.*" \ + "Temporary breakpoint..* file .*$srcfile, line 1241.*" \ "tbreakpoint line 1241" send_gdb "continue\n" @@ -355,7 +355,7 @@ gdb_test "continue" \ #go -until 1281 gdb_test "tbreak 1281" \ - "Breakpoint.* file .*call-ar-st.c, line 1281.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1281.*" \ "tbreakpoint line 1281" if ![gdb_skip_stdio_test "continuing to 1281"] { @@ -443,7 +443,7 @@ if {![gdb_skip_float_test "print print_t #go -until 1286 gdb_test "tbreak 1286" \ - "Breakpoint .* file .*call-ar-st.c, line 1286.*" \ + "Temporary breakpoint .* file .*call-ar-st.c, line 1286.*" \ "tbreakpoint line 1286" gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286" @@ -471,7 +471,7 @@ if { [istarget "hppa*-*-hpux*"] } { # We can't just assume that a "step" will get us into # print_long_arg_list here,either. gdb_test "tbreak print_long_arg_list" \ - "Breakpoint .* file .*call-ar-st.c, line .*" \ + "Temporary breakpoint .* file .*call-ar-st.c, line .*" \ "tbreak in print_long_arg_list after stepping into memcpy" # The short match case below handles cases where a buffer # overflows or something, and expect can't deal with the full @@ -551,7 +551,7 @@ if {![gdb_skip_float_test "print_small_s #go -until 1300 gdb_test "tbreak 1300" \ - "Breakpoint.* file .*call-ar-st.c, line 1300.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1300.*" \ "tbreakpoint line 1300" if ![gdb_skip_stdio_test "continuing to 1300"] { @@ -590,7 +590,7 @@ if ![gdb_skip_stdio_test "continuing to #go -until 1305 gdb_test "tbreak 1305" \ - "Breakpoint.* file .*call-ar-st.c, line 1305.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1305.*" \ "tbreakpoint line 1305" gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \ @@ -650,7 +650,7 @@ if {![gdb_skip_float_test "print print_l #go -until 1311 gdb_test "tbreak 1311" \ - "Breakpoint.* file .*call-ar-st.c, line 1311.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1311.*" \ "tbreakpoint line 1311" gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \ Index: gdb.base/commands.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v retrieving revision 1.21 diff -u -p -r1.21 commands.exp --- gdb.base/commands.exp 1 Jan 2008 22:53:18 -0000 1.21 +++ gdb.base/commands.exp 15 Apr 2008 14:24:43 -0000 @@ -521,7 +521,7 @@ proc temporary_breakpoint_commands {} { # This test will verify that this commands list is executed when the # breakpoint is hit. gdb_test "tbreak factorial" \ - "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ + "Temporary breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ "breakpoint in temporary_breakpoint_commands" send_gdb "commands\n" Index: gdb.base/display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/display.exp,v retrieving revision 1.14 diff -u -p -r1.14 display.exp --- gdb.base/display.exp 1 Jan 2008 22:53:18 -0000 1.14 +++ gdb.base/display.exp 15 Apr 2008 14:24:43 -0000 @@ -165,7 +165,7 @@ gdb_expect { } gdb_test "step" ".*do_vars.*.*27.*" -gdb_test "tbreak 37" ".*Breakpoint 5 a.*" +gdb_test "tbreak 37" ".*breakpoint 5 a.*" gdb_test "cont" ".*do_vars.*37.*37.*" # Beat on printf a bit Index: gdb.base/foll-exec.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/foll-exec.exp,v retrieving revision 1.7 diff -u -p -r1.7 foll-exec.exp --- gdb.base/foll-exec.exp 29 Jan 2008 22:47:20 -0000 1.7 +++ gdb.base/foll-exec.exp 15 Apr 2008 14:24:43 -0000 @@ -283,7 +283,7 @@ proc do_exec_tests {} { # send_gdb "tbreak 27\n" gdb_expect { - -re "Breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\ {pass "prepare to jump to execl call"} -re "$gdb_prompt $" {fail "prepare to jump to execl call"} timeout {fail "(timeout) prepare to jump to execl call"} @@ -343,7 +343,7 @@ proc do_exec_tests {} { # send_gdb "tbreak 41\n" gdb_expect { - -re "Breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\ {pass "prepare to jump to execv call"} -re "$gdb_prompt $" {fail "prepare to jump to execv call"} timeout {fail "(timeout) prepare to jump to execv call"} Index: gdb.base/foll-fork.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/foll-fork.exp,v retrieving revision 1.8 diff -u -p -r1.8 foll-fork.exp --- gdb.base/foll-fork.exp 29 Jan 2008 22:47:20 -0000 1.8 +++ gdb.base/foll-fork.exp 15 Apr 2008 14:24:43 -0000 @@ -194,7 +194,7 @@ proc catch_fork_child_follow {} { } send_gdb "tbreak ${srcfile}:24\n" gdb_expect { - -re "Breakpoint.*, line 24.*$gdb_prompt $"\ + -re "Temporary breakpoint.*, line 24.*$gdb_prompt $"\ {pass "set follow child, tbreak"} -re "$gdb_prompt $" {fail "set follow child, tbreak"} timeout {fail "(timeout) set follow child, tbreak"} @@ -255,7 +255,7 @@ proc tcatch_fork_parent_follow {} { } send_gdb "tbreak ${srcfile}:24\n" gdb_expect { - -re "Breakpoint.*, line 24.*$gdb_prompt $"\ + -re "Temporary breakpoint.*, line 24.*$gdb_prompt $"\ {pass "set follow parent, tbreak"} -re "$gdb_prompt $" {fail "set follow parent, tbreak"} timeout {fail "(timeout) set follow child, tbreak"} Index: gdb.base/restore.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/restore.exp,v retrieving revision 1.11 diff -u -p -r1.11 restore.exp --- gdb.base/restore.exp 1 Jan 2008 22:53:19 -0000 1.11 +++ gdb.base/restore.exp 15 Apr 2008 14:24:43 -0000 @@ -54,7 +54,7 @@ proc restore_tests { } { for {set c 1} {$c <= $limit} {incr c} { # Set a breakpoint at the next caller function. - gdb_test "tbreak caller$c" "Breakpoint.*\[0-9\]*\\." \ + gdb_test "tbreak caller$c" "Temporary breakpoint.*\[0-9\]*\\." \ "tbreak caller$c" # Continue to the next caller function. @@ -63,7 +63,7 @@ proc restore_tests { } { # Do each callee function. for {set e 1} {$e <= $limit} {incr e} { - gdb_test "tbreak callee$e" "Breakpoint.*\[0-9\]*\\." \ + gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \ "caller$c calls callee$e; tbreak callee" gdb_test "continue" " callee$e prologue .*/" \ Index: gdb.base/sepdebug.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sepdebug.exp,v retrieving revision 1.15 diff -u -p -r1.15 sepdebug.exp --- gdb.base/sepdebug.exp 26 Feb 2008 08:14:11 -0000 1.15 +++ gdb.base/sepdebug.exp 15 Apr 2008 14:24:43 -0000 @@ -261,13 +261,13 @@ delete_breakpoints # test temporary breakpoint at function # -gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" +gdb_test "tbreak main" "Temporary breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" # # test break at function in file # -gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ +gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$srcfile, line.*" \ "Temporary breakpoint function in file" # @@ -275,25 +275,25 @@ gdb_test "tbreak $srcfile:factorial" "Br # send_gdb "tbreak $bp_location1\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } timeout { fail "breakpoint line number #1 (timeout)" } } -gdb_test "tbreak $bp_location6" "Breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" +gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" # # test break at line number in file # send_gdb "tbreak $srcfile:$bp_location2\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } timeout { fail "Temporary breakpoint line number in file #1 (timeout)" } } set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] -gdb_test "tbreak $srcfile:$bp_location11" "Breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" +gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" # # check to see what breakpoints are set (temporary this time) Index: gdb.base/watchpoint.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v retrieving revision 1.17 diff -u -p -r1.17 watchpoint.exp --- gdb.base/watchpoint.exp 3 Mar 2008 13:24:12 -0000 1.17 +++ gdb.base/watchpoint.exp 15 Apr 2008 14:24:44 -0000 @@ -606,7 +606,7 @@ proc test_complex_watchpoint {} { # local to a recursing function should be bound only to that # one invocation, and should not trigger for other invocations. # - gdb_test "tbreak recurser" ".*Breakpoint.*" + gdb_test "tbreak recurser" ".*breakpoint.*" gdb_test "cont" "Continuing.*recurser.*" gdb_test "watch local_x" ".*\[Ww\]atchpoint \[0-9\]*: local_x" \ "set local watch in recursive call" Index: gdb.mi/mi-cli.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v retrieving revision 1.12 diff -u -p -r1.12 mi-cli.exp --- gdb.mi/mi-cli.exp 5 Apr 2008 17:12:46 -0000 1.12 +++ gdb.mi/mi-cli.exp 15 Apr 2008 14:24:44 -0000 @@ -96,8 +96,8 @@ mi_gdb_test "-interpreter-exec console \ ".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \ "-interpreter-exec console \"list\"" -mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" "" \ - "continue to callee4" +mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" \ + { "" "disp=\"keep\"" } "continue to callee4" # NOTE: cagney/2003-02-03: Not yet. # mi_gdb_test "100-interpreter-exec console \"delete 2\"" \ @@ -147,7 +147,8 @@ mi_gdb_test "600-break-insert -t basics. {600\^done,bkpt=.number="3",type="breakpoint".*\}} \ "-break-insert -t basics.c:\$line_main_hello" -mi_execute_to "exec-continue" "" "main" "" ".*basics.c" $line_main_hello "" \ +mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*basics.c" \ + $line_main_hello { "" "disp=\"del\"" } \ "-exec-continue to line $line_main_hello" mi_execute_to "exec-next" "end-stepping-range" "main" "" ".*basics.c" $line_main_return "" \ Index: gdb.mi/mi-pending.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pending.exp,v retrieving revision 1.4 diff -u -p -r1.4 mi-pending.exp --- gdb.mi/mi-pending.exp 5 Apr 2008 17:12:46 -0000 1.4 +++ gdb.mi/mi-pending.exp 15 Apr 2008 14:24:44 -0000 @@ -68,5 +68,6 @@ mi_gdb_test "-break-insert -f pendfunc1" "MI pending breakpoint on pendfunc1" mi_run_cmd -mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" "" \ - "Run till MI pending breakpoint on pendfunc1" \ No newline at end of file +mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ + { "" "disp=\"keep\"" } \ + "Run till MI pending breakpoint on pendfunc1" Index: gdb.mi/mi-simplerun.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v retrieving revision 1.19 diff -u -p -r1.19 mi-simplerun.exp --- gdb.mi/mi-simplerun.exp 5 Apr 2008 17:12:46 -0000 1.19 +++ gdb.mi/mi-simplerun.exp 15 Apr 2008 14:24:44 -0000 @@ -113,7 +113,8 @@ proc test_running_the_program {} { # two prompts involved and this can lead to a race condition. # The following is equivalent to a send_gdb "000-exec-run\n" mi_run_cmd - mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" "" "run to main" + mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" \ + { "" "disp=\"keep\"" } "run to main" } proc test_controlled_execution {} { Index: gdb.mi/mi-until.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v retrieving revision 1.16 diff -u -p -r1.16 mi-until.exp --- gdb.mi/mi-until.exp 5 Apr 2008 17:12:46 -0000 1.16 +++ gdb.mi/mi-until.exp 15 Apr 2008 14:24:44 -0000 @@ -55,7 +55,8 @@ proc test_running_to_foo {} { "break-insert operation" mi_run_cmd - mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 "" "run to main" + mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \ + { "" "disp=\"keep\"" } "run to main" mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" Index: gdb.mi/mi-var-cmd.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v retrieving revision 1.38 diff -u -p -r1.38 mi-var-cmd.exp --- gdb.mi/mi-var-cmd.exp 13 Apr 2008 09:33:49 -0000 1.38 +++ gdb.mi/mi-var-cmd.exp 15 Apr 2008 14:24:44 -0000 @@ -581,7 +581,8 @@ mi_run_inline_test floating set do_at_tests_callee_breakpoint [gdb_get_line_number "breakpoint inside callee"] mi_gdb_test "-break-insert var-cmd.c:$do_at_tests_callee_breakpoint" ".*" \ "inside breakpoint inside callee" -mi_execute_to "exec-continue" "breakpoint-hit" do_at_tests_callee "" ".*" ".*" ""\ +mi_execute_to "exec-continue" "breakpoint-hit" do_at_tests_callee "" ".*" ".*" \ + { "" "disp=\"keep\"" } \ "continue to where i is initialized" mi_varobj_update F {F} "update F inside callee" Index: gdb.mi/mi-var-display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v retrieving revision 1.27 diff -u -p -r1.27 mi-var-display.exp --- gdb.mi/mi-var-display.exp 9 Apr 2008 13:29:50 -0000 1.27 +++ gdb.mi/mi-var-display.exp 15 Apr 2008 14:24:44 -0000 @@ -47,7 +47,8 @@ mi_gdb_test "200-break-insert $srcfile:$ "break-insert operation" mi_run_cmd -mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" $line_dct_end "" "run to main" +mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" \ + $line_dct_end { "" "disp=\"keep\"" } "run to main" ##### ##### # # @@ -374,7 +375,8 @@ mi_gdb_test "200-break-insert $line_dst_ "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"$line_dst_incr_a_2\",times=\"0\"\}" \ "break-insert operation" -mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" ".*var-cmd.c" $line_dst_incr_a_2 "" \ +mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" \ + ".*var-cmd.c" $line_dst_incr_a_2 { "" "disp=\"keep\"" } \ "continue to do_special_tests" # Test: c_variable-7.10 Index: gdb.mi/mi2-cli.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-cli.exp,v retrieving revision 1.11 diff -u -p -r1.11 mi2-cli.exp --- gdb.mi/mi2-cli.exp 5 Apr 2008 17:12:46 -0000 1.11 +++ gdb.mi/mi2-cli.exp 15 Apr 2008 14:24:44 -0000 @@ -96,7 +96,8 @@ mi_gdb_test "-interpreter-exec console \ ".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \ "-interpreter-exec console \"list\"" -mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" "" \ +mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" \ + { "" "disp=\"keep\"" } \ "continue to callee4" # NOTE: cagney/2003-02-03: Not yet. @@ -147,7 +148,8 @@ mi_gdb_test "600-break-insert -t basics. {600\^done,bkpt=.number="3",type="breakpoint".*\}} \ "-break-insert -t basics.c:\$line_main_hello" -mi_execute_to "exec-continue" "" "main" "" ".*basics.c" $line_main_hello "" \ +mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*basics.c" \ + $line_main_hello { "" "disp=\"del\"" } \ "-exec-continue to line $line_main_hello" mi_execute_to "exec-next" "end-stepping-range" "main" "" ".*basics.c" $line_main_return "" \ Index: gdb.mi/mi2-simplerun.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v retrieving revision 1.10 diff -u -p -r1.10 mi2-simplerun.exp --- gdb.mi/mi2-simplerun.exp 5 Apr 2008 17:12:46 -0000 1.10 +++ gdb.mi/mi2-simplerun.exp 15 Apr 2008 14:24:44 -0000 @@ -113,7 +113,8 @@ proc test_running_the_program {} { # two prompts involved and this can lead to a race condition. # The following is equivalent to a send_gdb "000-exec-run\n" mi_run_cmd - mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" "" "run to main" + mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" \ + {"" "disp=\"keep\"" } "run to main" } proc test_controlled_execution {} { Index: gdb.mi/mi2-until.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v retrieving revision 1.10 diff -u -p -r1.10 mi2-until.exp --- gdb.mi/mi2-until.exp 5 Apr 2008 17:12:46 -0000 1.10 +++ gdb.mi/mi2-until.exp 15 Apr 2008 14:24:44 -0000 @@ -56,7 +56,8 @@ proc test_running_to_foo {} { "break-insert operation" mi_run_cmd - mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 "" "run to main" + mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \ + { "" "disp=\"keep\"" } "run to main" mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" Index: gdb.mi/mi2-var-display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v retrieving revision 1.20 diff -u -p -r1.20 mi2-var-display.exp --- gdb.mi/mi2-var-display.exp 9 Apr 2008 13:29:50 -0000 1.20 +++ gdb.mi/mi2-var-display.exp 15 Apr 2008 14:24:44 -0000 @@ -47,7 +47,8 @@ mi_gdb_test "200-break-insert $srcfile:$ "break-insert operation" mi_run_cmd -mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" $line_dct_end "" "run to main" +mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" \ + $line_dct_end { "" "disp=\"keep\"" } "run to main" ##### ##### # # @@ -373,7 +374,8 @@ mi_gdb_test "200-break-insert $line_dst_ "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"$line_dst_incr_a_2\",times=\"0\"\}" \ "break-insert operation" -mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" ".*var-cmd.c" $line_dst_incr_a_2 "" \ +mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" \ + ".*var-cmd.c" $line_dst_incr_a_2 { "" "disp=\"keep\"" } \ "continue to do_special_tests" # Test: c_variable-7.10 Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.99 diff -u -p -r1.99 gdb.exp --- lib/gdb.exp 7 Apr 2008 16:32:44 -0000 1.99 +++ lib/gdb.exp 15 Apr 2008 14:24:46 -0000 @@ -337,17 +337,19 @@ proc gdb_breakpoint { function args } { } set break_command "break" + set break_message "Breakpoint" if {[lsearch -exact [lindex $args 0] temporary] != -1} { set break_command "tbreak" + set break_message "Temporary breakpoint" } send_gdb "$break_command $function\n" # The first two regexps are what we get with -g, the third is without -g. gdb_expect 30 { - -re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} - -re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {} - -re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {} - -re "Breakpoint \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { + -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} + -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {} + -re "$break_message \[0-9\]* at .*$gdb_prompt $" {} + -re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { if {$pending_response == "n"} { fail "setting breakpoint at $function" return 0 Index: lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.55 diff -u -p -r1.55 mi-support.exp --- lib/mi-support.exp 13 Apr 2008 09:33:49 -0000 1.55 +++ lib/mi-support.exp 15 Apr 2008 14:24:46 -0000 @@ -889,7 +889,7 @@ proc mi_runto_helper {func run_or_contin mi_send_resuming_command "exec-continue" "$test" } - mi_expect_stop "" $func ".*" ".*" "\[0-9\]+" "" $test + mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } $test } proc mi_runto {func} { @@ -970,13 +970,16 @@ proc mi_expect_stop { reason func args f set r "reason=\"$reason\"," } - verbose -log "mi_expect_stop: expecting: .*220\\*stopped,${r}${bn}${after_reason}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$mi_gdb_prompt$" + + set a $after_reason + + verbose -log "mi_expect_stop: expecting: .*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$mi_gdb_prompt$" gdb_expect { - -re ".*220\\*stopped,${r}${bn}${after_reason}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$mi_gdb_prompt$" { + -re ".*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$mi_gdb_prompt$" { pass "$test" return $expect_out(2,string) } - -re ".*220\\*stopped,${r}${bn}${after_reason}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" { + -re ".*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" { fail "$test (stopped at wrong place)" return -1 } ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 @ 2008-04-23 17:48 Aleksandar Ristovski 2008-04-23 17:49 ` Vladimir Prus 0 siblings, 1 reply; 23+ messages in thread From: Aleksandar Ristovski @ 2008-04-23 17:48 UTC (permalink / raw) To: Vladimir Prus; +Cc: gdb-patches Vladimir Prus wrote: > Aleksandar Ristovski wrote: > >> NOTE3: In mi-support.exp (mi_expect_stop), I put argument "after_reason" to >> be >> after the reason > > Why? Neither your email nor changelog entry fail to explain the motivation > for the change. > The field is named "after_reason" and it hadn't been used. It looked like someone meant to use it for after reason field, but was placed after 'thread-id' field - I might have made wrong conclusion, this is why I emphasised the change in the note above. It is a local variable so it should not be a problem to switch it back, add new param for 'disp' field or whatever. --- Aleksandar ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-04-23 17:48 Aleksandar Ristovski @ 2008-04-23 17:49 ` Vladimir Prus 0 siblings, 0 replies; 23+ messages in thread From: Vladimir Prus @ 2008-04-23 17:49 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: gdb-patches On Wednesday 23 April 2008 17:43:41 Aleksandar Ristovski wrote: > Vladimir Prus wrote: > > Aleksandar Ristovski wrote: > > > >> NOTE3: In mi-support.exp (mi_expect_stop), I put argument "after_reason" > to > >> be > >> after the reason > > > > Why? Neither your email nor changelog entry fail to explain the motivation > > for the change. > > > > The field is named "after_reason" and it hadn't been used. It looked like > someone meant to use it for after reason field, but was placed after > 'thread-id' field - I might have made wrong conclusion, this is why I > emphasised the change in the note above. > > It is a local variable so it should not be a problem to switch it back, add > new param for 'disp' field or whatever. I see. I did not realize that this variable is actually used *after* your patch, so wondered why changing a variable if it has no effect. So far, except for a couple of conflicts, I did not run into any issues with this change. Thanks for explaining, Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424
@ 2008-04-16 18:28 Aleksandar Ristovski
0 siblings, 0 replies; 23+ messages in thread
From: Aleksandar Ristovski @ 2008-04-16 18:28 UTC (permalink / raw)
To: Vladimir Prus; +Cc: Daniel Jacobowitz, gdb-patches, nickrob
Vladimir Prus wrote:
> Can you post the final patch that was checked in, so that I glance on
> testsuite changes?
>
> - Volodya
>
Yes, I posted it, please see this message:
http://sourceware.org/ml/gdb-patches/2008-04/msg00289.html
Thanks,
Aleksandar
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [patch] fix for PR2424
@ 2008-04-15 15:07 Aleksandar Ristovski
2008-04-15 15:25 ` Daniel Jacobowitz
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: Aleksandar Ristovski @ 2008-04-15 15:07 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Vladimir Prus, gdb-patches, nickrob
Daniel Jacobowitz wrote:
> On Mon, Apr 14, 2008 at 10:41:38AM -0400, Aleksandar Ristovski wrote:
>> ping?
>
> Thanks. The most recent version of this patch (code + testsuite) is OK.
>
> Please mention the PR at the top of the changelog entry, like this:
>
> DATE NAME <ADDR>
>
> PR gdb/2424
> * infrun.c (some change): ....
>
> Then if you include that line in the commit message, the changelog
> entry is automatically appended to the PR audit trail.
>
> Shouldn't the disp="del" field be described in the manual? If so,
> that can be a separate patch.
>
Committed.
NOTE1 (reminder): With this patch, we have new field in the *stopped
message,
when "reason == breakpoint-hit" - we will have "disp" field printed; the
value
of the field will be exactly the same as the value printed when the
breakpoint
was created.
NOTE2: Due to quite significant rework of certain functions in
mi-support.exp,
committed diff for testsuite is not exactly the same as the one I posted. I
took
liberty to commit anyway since the changes are functionally the same; note
the
slightly awkward syntax for "mi_expect_stop" call, namely the "extra"
argument
which now must be something like { "" "disp=\"keep\"" } - I don't think it's
too
bad (it can be beautified later).
NOTE3: In mi-support.exp (mi_expect_stop), I put argument "after_reason" to
be
after the reason (I couldn't find it being used anywhere anyway, so this
should
be a safe change).
NOTE4: Documentation is not updated (I will try to do that now and submit
the
diff for approval).
Thanks,
Aleksandar Ristovski
QNX Software Systems
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [patch] fix for PR2424 2008-04-15 15:07 Aleksandar Ristovski @ 2008-04-15 15:25 ` Daniel Jacobowitz 2008-04-16 13:17 ` Vladimir Prus 2008-04-23 11:16 ` Vladimir Prus 2 siblings, 0 replies; 23+ messages in thread From: Daniel Jacobowitz @ 2008-04-15 15:25 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Vladimir Prus, gdb-patches, nickrob On Tue, Apr 15, 2008 at 10:43:47AM -0400, Aleksandar Ristovski wrote: > NOTE2: Due to quite significant rework of certain functions in > mi-support.exp, > committed diff for testsuite is not exactly the same as the one I posted. I > took > liberty to commit anyway since the changes are functionally the same; note > the > slightly awkward syntax for "mi_expect_stop" call, namely the "extra" > argument > which now must be something like { "" "disp=\"keep\"" } - I don't think it's > too > bad (it can be beautified later). Committing anyway is fine. When you commit a modified version of a patch, though, please post the final version for the list archives. Thanks. That way anyone whose code is affected can see the changes. > NOTE3: In mi-support.exp (mi_expect_stop), I put argument "after_reason" to > be > after the reason (I couldn't find it being used anywhere anyway, so this > should > be a safe change). Vladimir presumably has plans for it :-) > NOTE4: Documentation is not updated (I will try to do that now and submit > the > diff for approval). Thanks. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-04-15 15:07 Aleksandar Ristovski 2008-04-15 15:25 ` Daniel Jacobowitz @ 2008-04-16 13:17 ` Vladimir Prus 2008-04-23 11:16 ` Vladimir Prus 2 siblings, 0 replies; 23+ messages in thread From: Vladimir Prus @ 2008-04-16 13:17 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Daniel Jacobowitz, gdb-patches, nickrob On Tuesday 15 April 2008 18:43:47 Aleksandar Ristovski wrote: > Daniel Jacobowitz wrote: > > On Mon, Apr 14, 2008 at 10:41:38AM -0400, Aleksandar Ristovski wrote: > >> ping? > > > > Thanks. The most recent version of this patch (code + testsuite) is OK. > > > > Please mention the PR at the top of the changelog entry, like this: > > > > DATE NAME <ADDR> > > > > PR gdb/2424 > > * infrun.c (some change): .... > > > > Then if you include that line in the commit message, the changelog > > entry is automatically appended to the PR audit trail. > > > > Shouldn't the disp="del" field be described in the manual? If so, > > that can be a separate patch. > > > Committed. > > NOTE1 (reminder): With this patch, we have new field in the *stopped > message, > when "reason == breakpoint-hit" - we will have "disp" field printed; the > value > of the field will be exactly the same as the value printed when the > breakpoint > was created. > > NOTE2: Due to quite significant rework of certain functions in > mi-support.exp, > committed diff for testsuite is not exactly the same as the one I posted. I > took > liberty to commit anyway since the changes are functionally the same; note > the > slightly awkward syntax for "mi_expect_stop" call, namely the "extra" > argument > which now must be something like { "" "disp=\"keep\"" } - I don't think it's > too > bad (it can be beautified later). Can you post the final patch that was checked in, so that I glance on testsuite changes? - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-04-15 15:07 Aleksandar Ristovski 2008-04-15 15:25 ` Daniel Jacobowitz 2008-04-16 13:17 ` Vladimir Prus @ 2008-04-23 11:16 ` Vladimir Prus 2 siblings, 0 replies; 23+ messages in thread From: Vladimir Prus @ 2008-04-23 11:16 UTC (permalink / raw) To: Aleksandar Ristovski, gdb-patches Aleksandar Ristovski wrote: > NOTE3: In mi-support.exp (mi_expect_stop), I put argument "after_reason" to > be > after the reason Why? Neither your email nor changelog entry fail to explain the motivation for the change. - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 @ 2008-04-14 15:16 Aleksandar Ristovski 2008-04-14 18:06 ` Daniel Jacobowitz 0 siblings, 1 reply; 23+ messages in thread From: Aleksandar Ristovski @ 2008-04-14 15:16 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Vladimir Prus, gdb-patches, nickrob ping? Aleksandar Ristovski wrote: > Vladimir Prus wrote: >> On Monday 10 March 2008 20:18:06 Aleksandar Ristovski wrote: >>> Vladimir Prus wrote: >>> The proposed patch (attached) will produce the following outputs: >>> >>> CLI: >>> (gdb) tbreak main >>> Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. >>> (gdb) r >>> Starting program: /space/src/testcases/sigsegv/main >>> >>> Temporary breakpoint 1, main () at ./main.c:15 >>> 15 foo (p); >>> >>> MI: >>> (gdb) >>> -break-insert -t main >>> ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0804 83a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/mai n.c",line="15",times="0"} >>> (gdb) >>> -exec-run >>> ^running >>> (gdb) >>> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={ addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/t estcases/sigsegv/main.c",line="15"} >>> >> For consistency, it's better to use same printing of 'disp' as done >> in print_one_breakpoint_location: >> >> ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); >> >> bpdisps is actually a table local to print_one_breakpoint_location, >> but there's no reason why it cannot be made a global table. >> >> - Volodya >> > > New diff for code (testsuite remains the same as in previous email). Static > array bpstats moved to new function bpstat_text and function used. > > Note: I believe docs need also be changed since in the examples for mi protocol > there are no 'disp' fields. But I am not sure where do I need to make those changes. > > 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> > > * infrun.c (normal_stop) Move breakpoint_auto_delete further down > to allow printing to 'see' real reason of stop. This fixes PR 2424. > * breakpoint.c (bpdisp_texst): New function. The function takes over > the role of bpstats static array in print_one_breakpoint_location. > (print_it_typical): Print "Temporary breakpoint" instead > of just "Breakpoint" when breakpoint is, well, temporary. For mi-like > protocols, print disp field. > (print_one_breakpoint_location): Removed bpdisps static definition. > Call new bpstat_text function to get value for 'disp' field. > (mention): Print "Temporary breakpoint" instead of just "Breakpoint". > > > > ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-04-14 15:16 Aleksandar Ristovski @ 2008-04-14 18:06 ` Daniel Jacobowitz 0 siblings, 0 replies; 23+ messages in thread From: Daniel Jacobowitz @ 2008-04-14 18:06 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Vladimir Prus, gdb-patches, nickrob On Mon, Apr 14, 2008 at 10:41:38AM -0400, Aleksandar Ristovski wrote: > ping? Thanks. The most recent version of this patch (code + testsuite) is OK. Please mention the PR at the top of the changelog entry, like this: DATE NAME <ADDR> PR gdb/2424 * infrun.c (some change): .... Then if you include that line in the commit message, the changelog entry is automatically appended to the PR audit trail. Shouldn't the disp="del" field be described in the manual? If so, that can be a separate patch. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 @ 2008-04-01 19:41 Aleksandar Ristovski 0 siblings, 0 replies; 23+ messages in thread From: Aleksandar Ristovski @ 2008-04-01 19:41 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Vladimir Prus, gdb-patches, nickrob Aleksandar Ristovski wrote: > Vladimir Prus wrote: >> On Monday 10 March 2008 20:18:06 Aleksandar Ristovski wrote: >>> Vladimir Prus wrote: >>> The proposed patch (attached) will produce the following outputs: >>> >>> CLI: >>> (gdb) tbreak main >>> Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. >>> (gdb) r >>> Starting program: /space/src/testcases/sigsegv/main >>> >>> Temporary breakpoint 1, main () at ./main.c:15 >>> 15 foo (p); >>> >>> MI: >>> (gdb) >>> -break-insert -t main >>> ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0804 83a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/mai n.c",line="15",times="0"} >>> (gdb) >>> -exec-run >>> ^running >>> (gdb) >>> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={ addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/t estcases/sigsegv/main.c",line="15"} >>> >> For consistency, it's better to use same printing of 'disp' as done >> in print_one_breakpoint_location: >> >> ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); >> >> bpdisps is actually a table local to print_one_breakpoint_location, >> but there's no reason why it cannot be made a global table. >> >> - Volodya >> > > New diff for code (testsuite remains the same as in previous email). Static > array bpstats moved to new function bpstat_text and function used. > > Note: I believe docs need also be changed since in the examples for mi protocol > there are no 'disp' fields. But I am not sure where do I need to make those changes. > > 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> > > * infrun.c (normal_stop) Move breakpoint_auto_delete further down > to allow printing to 'see' real reason of stop. This fixes PR 2424. > * breakpoint.c (bpdisp_texst): New function. The function takes over > the role of bpstats static array in print_one_breakpoint_location. > (print_it_typical): Print "Temporary breakpoint" instead > of just "Breakpoint" when breakpoint is, well, temporary. For mi-like > protocols, print disp field. > (print_one_breakpoint_location): Removed bpdisps static definition. > Call new bpstat_text function to get value for 'disp' field. > (mention): Print "Temporary breakpoint" instead of just "Breakpoint". > Any thoughts on this? ^ permalink raw reply [flat|nested] 23+ messages in thread
* [patch] fix for PR2424
@ 2008-03-05 17:36 Aleksandar Ristovski
2008-03-08 11:31 ` Nick Roberts
2008-03-08 18:36 ` Vladimir Prus
0 siblings, 2 replies; 23+ messages in thread
From: Aleksandar Ristovski @ 2008-03-05 17:36 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 518 bytes --]
Hello,
With the attached patch for testsuite and the patch itself, the PR should be fixed.
Thanks,
Aleksandar Ristovski
QNX Software Systems
Testsuite:
2008-03-05 Aleksandar Ristovski <aristovski@qnx.com>
* gdb.mi/mi-support.exp: Add "reason" to the matching pattern. This
is to support fix for PR2424.
infrun.c:
2008-03-05 Aleksandar Ristovski <aristovski@qnx.com>
* infrun.c (normal_stop) Move breakpoint_auto_delete further down
to allow printing to 'see' real reason of stop. This fixes PR 2424.
[-- Attachment #2: mi-support.exp.diff --]
[-- Type: text/plain, Size: 645 bytes --]
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.51
diff -r1.51 mi-support.exp
893c893
< -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
---
> -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
[-- Attachment #3: infrun.c.diff --]
[-- Type: text/plain, Size: 1007 bytes --]
Index: gdb/infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.266
diff -u -p -r1.266 infrun.c
--- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266
+++ gdb/infrun.c 5 Mar 2008 16:08:02 -0000
@@ -3151,11 +3151,6 @@ Further execution is probably impossible
}
}
- /* Delete the breakpoint we stopped at, if it wants to be deleted.
- Delete any breakpoint that is to be deleted at the next stop. */
-
- breakpoint_auto_delete (stop_bpstat);
-
/* If an auto-display called a function and that got a signal,
delete that auto-display to avoid an infinite recursion. */
@@ -3292,6 +3287,9 @@ Further execution is probably impossible
}
done:
+ /* Delete the breakpoint we stopped at, if it wants to be deleted.
+ Delete any breakpoint that is to be deleted at the next stop. */
+ breakpoint_auto_delete (stop_bpstat);
annotate_stopped ();
observer_notify_normal_stop (stop_bpstat);
}
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [patch] fix for PR2424 2008-03-05 17:36 Aleksandar Ristovski @ 2008-03-08 11:31 ` Nick Roberts 2008-03-08 18:36 ` Vladimir Prus 1 sibling, 0 replies; 23+ messages in thread From: Nick Roberts @ 2008-03-08 11:31 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: gdb-patches > With the attached patch for testsuite and the patch itself, the PR should be > fixed. It's not the right fix, though, because from a console the temporary breakpoint now gets reported when execution stops. Currently: (gdb) tbreak main Breakpoint 1 at 0x8048687: file myprog.c, line 95. (gdb) run Starting program: /home/nickrob/myprog main (argc=1, argv=0xbfcacf74) at myprog.c:95 95 main (int argc, char **argv) { (gdb) After your change: (gdb) tbreak main Breakpoint 1 at 0x8048687: file myprog.c, line 95. (gdb) run Starting program: /home/nickrob/myprog Breakpoint 1, main (argc=1, argv=0xbf844314) at myprog.c:95 95 main (int argc, char **argv) { (gdb) > Thanks, > > Aleksandar Ristovski > QNX Software Systems > > > Testsuite: > 2008-03-05 Aleksandar Ristovski <aristovski@qnx.com> > > * gdb.mi/mi-support.exp: Add "reason" to the matching pattern. This > is to support fix for PR2424. > > infrun.c: > 2008-03-05 Aleksandar Ristovski <aristovski@qnx.com> > > * infrun.c (normal_stop) Move breakpoint_auto_delete further down > to allow printing to 'see' real reason of stop. This fixes PR 2424. > > > > Index: gdb/testsuite/lib/mi-support.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v > retrieving revision 1.51 > diff -r1.51 mi-support.exp > 893c893 > < -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { > --- > > -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { > Index: gdb/infrun.c > =================================================================== > RCS file: /cvs/src/src/gdb/infrun.c,v > retrieving revision 1.266 > diff -u -p -r1.266 infrun.c > --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 > +++ gdb/infrun.c 5 Mar 2008 16:08:02 -0000 > @@ -3151,11 +3151,6 @@ Further execution is probably impossible > } > } > > - /* Delete the breakpoint we stopped at, if it wants to be deleted. > - Delete any breakpoint that is to be deleted at the next stop. */ > - > - breakpoint_auto_delete (stop_bpstat); > - > /* If an auto-display called a function and that got a signal, > delete that auto-display to avoid an infinite recursion. */ > > @@ -3292,6 +3287,9 @@ Further execution is probably impossible > } > > done: > + /* Delete the breakpoint we stopped at, if it wants to be deleted. > + Delete any breakpoint that is to be deleted at the next stop. */ > + breakpoint_auto_delete (stop_bpstat); > annotate_stopped (); > observer_notify_normal_stop (stop_bpstat); > } -- Nick http://www.inet.net.nz/~nickrob ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-05 17:36 Aleksandar Ristovski 2008-03-08 11:31 ` Nick Roberts @ 2008-03-08 18:36 ` Vladimir Prus 2008-03-09 0:12 ` Aleksandar Ristovski 1 sibling, 1 reply; 23+ messages in thread From: Vladimir Prus @ 2008-03-08 18:36 UTC (permalink / raw) To: gdb-patches Aleksandar Ristovski wrote: > Hello, > > With the attached patch for testsuite and the patch itself, the PR should be fixed. > > Thanks, > > Aleksandar Ristovski > QNX Software Systems > > > Testsuite: > 2008-03-05 Aleksandar Ristovski <aristovski@qnx.com> > > * gdb.mi/mi-support.exp: Add "reason" to the matching pattern. This > is to support fix for PR2424. FWIW, you don't say what function in mi-support.exp is changed, and it would be better if your patch was generated with -u (unified diff, 3 lines of context) -- the current one has no context at all, so I can only guess which function that is. Speaking of the problem itself -- in PR2424 you say: When inferior stops at temporary breakpoint, message is: *stopped,thread-id="0",....... without mentioning "reason=breakpoint-hit" This causes issues for multithreaded programs. What issues does it cause for MT programs? - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-08 18:36 ` Vladimir Prus @ 2008-03-09 0:12 ` Aleksandar Ristovski 2008-03-09 3:32 ` Nick Roberts 2008-03-10 8:11 ` Vladimir Prus 0 siblings, 2 replies; 23+ messages in thread From: Aleksandar Ristovski @ 2008-03-09 0:12 UTC (permalink / raw) To: Vladimir Prus; +Cc: gdb-patches, nickrob [-- Attachment #1: Type: text/plain, Size: 1395 bytes --] Vladimir Prus wrote: > FWIW, you don't say what function in mi-support.exp is changed, > and it would be better if your patch was generated with -u (unified diff, > 3 lines of context) -- the current one has no context at all, so I > can only guess which function that is. Please find attached new diffs. > > Speaking of the problem itself -- in PR2424 you say: > > When inferior stops at temporary breakpoint, message is: > *stopped,thread-id="0",....... > without mentioning "reason=breakpoint-hit" > This causes issues for multithreaded programs. > > What issues does it cause for MT programs? When inferior hits a temporary breakpoint, due to breakpoint removal the reason for stop is "lost in translation". This leaves user guessing what the reason for stop was. This is applicable to both single and multi threaded inferiors, but gets more annoying when multiple threads exist since then client program (in my case IDE - CDT) can not figure out which thread caused the stop in addition to not knowing the reason (I am not working on CDT but I was explained that missing "reason" is to blame, and after the patch I proposed I was told things now work as expected). @Nick: I think the breakpoint should be reported. The fact that it is temporary doesn't make it much different than a regular breakpoint... but maybe I'm missing something. [-- Attachment #2: PR2424test.diff --] [-- Type: text/plain, Size: 896 bytes --] Index: gdb/testsuite/lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.51 diff -u -p -r1.51 mi-support.exp --- gdb/testsuite/lib/mi-support.exp 29 Jan 2008 19:36:58 -0000 1.51 +++ gdb/testsuite/lib/mi-support.exp 9 Mar 2008 00:03:39 -0000 @@ -890,7 +890,7 @@ proc mi_runto_helper {func run_or_contin } gdb_expect { - -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } [-- Attachment #3: PR2424infrun.c.diff --] [-- Type: text/plain, Size: 1007 bytes --] Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.266 diff -u -p -r1.266 infrun.c --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 +++ gdb/infrun.c 9 Mar 2008 00:04:36 -0000 @@ -3151,11 +3151,6 @@ Further execution is probably impossible } } - /* Delete the breakpoint we stopped at, if it wants to be deleted. - Delete any breakpoint that is to be deleted at the next stop. */ - - breakpoint_auto_delete (stop_bpstat); - /* If an auto-display called a function and that got a signal, delete that auto-display to avoid an infinite recursion. */ @@ -3292,6 +3287,9 @@ Further execution is probably impossible } done: + /* Delete the breakpoint we stopped at, if it wants to be deleted. + Delete any breakpoint that is to be deleted at the next stop. */ + breakpoint_auto_delete (stop_bpstat); annotate_stopped (); observer_notify_normal_stop (stop_bpstat); } ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-09 0:12 ` Aleksandar Ristovski @ 2008-03-09 3:32 ` Nick Roberts 2008-03-09 4:55 ` Aleksandar Ristovski 2008-03-10 8:11 ` Vladimir Prus 1 sibling, 1 reply; 23+ messages in thread From: Nick Roberts @ 2008-03-09 3:32 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: Vladimir Prus, gdb-patches > ...(I am not working on CDT but I was explained that > missing "reason" is to blame, and after the patch I proposed I was told > things now work as expected). As expected for CDT, you mean? > @Nick: I think the breakpoint should be reported. The fact that it is > temporary doesn't make it much different than a regular breakpoint... but > maybe I'm missing something. It's only a message so it's probably not that important, but when the user sees: Breakpoint 1, main (argc=1, argv=0xbf844314) at myprog.c:95 and then looks at the breakpoint list and breakpoint 1 isn't there, he might get confused. Likewise for a frontend with a reason like "breakpoint-hit". Perhaps a new one, like "temporary-breakpoint-hit", is needed. >... > + /* Delete the breakpoint we stopped at, if it wants to be deleted. > + Delete any breakpoint that is to be deleted at the next stop. */ > + breakpoint_auto_delete (stop_bpstat); > annotate_stopped (); > observer_notify_normal_stop (stop_bpstat); > } If anyone ever uses observer_notify_normal_stop, then presumably breakpoint_auto_delete would need to go after that. -- Nick http://www.inet.net.nz/~nickrob ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-09 3:32 ` Nick Roberts @ 2008-03-09 4:55 ` Aleksandar Ristovski 0 siblings, 0 replies; 23+ messages in thread From: Aleksandar Ristovski @ 2008-03-09 4:55 UTC (permalink / raw) To: Nick Roberts; +Cc: Vladimir Prus, gdb-patches [-- Attachment #1: Type: text/plain, Size: 1826 bytes --] Nick Roberts wrote: > > ...(I am not working on CDT but I was explained that > > missing "reason" is to blame, and after the patch I proposed I was told > > things now work as expected). > > As expected for CDT, you mean? I think it can be generalized as "as expected by mi-client". That's my understanding. > > > @Nick: I think the breakpoint should be reported. The fact that it is > > temporary doesn't make it much different than a regular breakpoint... but > > maybe I'm missing something. > > It's only a message so it's probably not that important, but when the user sees: > > Breakpoint 1, main (argc=1, argv=0xbf844314) at myprog.c:95 > > and then looks at the breakpoint list and breakpoint 1 isn't there, he might > get confused. Well... yes... but presumably it was the user who put that breakpoint there in the first place. And on the flip side, the message makes it more clear what really caused inferior to stop. > > Likewise for a frontend with a reason like "breakpoint-hit". Perhaps a new > one, like "temporary-breakpoint-hit", is needed. I agree, the message in both cli and mi case can be more clear. I'm not sure, however, how much headache would this give to existing front-ends. Maybe none since currently in case of temporary breakpoint hit reason is missing altogether. > > >... > > + /* Delete the breakpoint we stopped at, if it wants to be deleted. > > + Delete any breakpoint that is to be deleted at the next stop. */ > > + breakpoint_auto_delete (stop_bpstat); > > annotate_stopped (); > > observer_notify_normal_stop (stop_bpstat); > > } > > If anyone ever uses observer_notify_normal_stop, then presumably > breakpoint_auto_delete would need to go after that. You are most probably right. New diff for infrun.c attached. [-- Attachment #2: PR2424infrun.c.diff --] [-- Type: text/plain, Size: 1012 bytes --] Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.266 diff -u -p -r1.266 infrun.c --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 +++ gdb/infrun.c 9 Mar 2008 04:48:34 -0000 @@ -3151,11 +3151,6 @@ Further execution is probably impossible } } - /* Delete the breakpoint we stopped at, if it wants to be deleted. - Delete any breakpoint that is to be deleted at the next stop. */ - - breakpoint_auto_delete (stop_bpstat); - /* If an auto-display called a function and that got a signal, delete that auto-display to avoid an infinite recursion. */ @@ -3294,6 +3289,9 @@ Further execution is probably impossible done: annotate_stopped (); observer_notify_normal_stop (stop_bpstat); + /* Delete the breakpoint we stopped at, if it wants to be deleted. + Delete any breakpoint that is to be deleted at the next stop. */ + breakpoint_auto_delete (stop_bpstat); } static int ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-09 0:12 ` Aleksandar Ristovski 2008-03-09 3:32 ` Nick Roberts @ 2008-03-10 8:11 ` Vladimir Prus 2008-03-10 14:29 ` Aleksandar Ristovski 1 sibling, 1 reply; 23+ messages in thread From: Vladimir Prus @ 2008-03-10 8:11 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: gdb-patches, nickrob On Sunday 09 March 2008 03:12:07 you wrote: > Vladimir Prus wrote: > > FWIW, you don't say what function in mi-support.exp is changed, > > and it would be better if your patch was generated with -u (unified diff, > > 3 lines of context) -- the current one has no context at all, so I > > can only guess which function that is. > > Please find attached new diffs. > > > > > > Speaking of the problem itself -- in PR2424 you say: > > > > When inferior stops at temporary breakpoint, message is: > > *stopped,thread-id="0",....... > > without mentioning "reason=breakpoint-hit" > > This causes issues for multithreaded programs. > > > > What issues does it cause for MT programs? > > When inferior hits a temporary breakpoint, due to breakpoint removal the reason > for stop is "lost in translation". This leaves user guessing what the reason for > stop was. This is applicable to both single and multi threaded inferiors, but > gets more annoying when multiple threads exist since then client program (in my > case IDE - CDT) can not figure out which thread caused the stop The GDB output you have provided above actually includes thread id, so what problem does CDT have with figuring thread? In fact, CDT4's RxThread.java has the following: // We were stopped for some unknown reason, for example // GDB for temporary breakpoints will not send the // "reason" ??? still fire a stopped event. if (list.isEmpty()) { if (session.getMIInferior().isRunning()) { session.getMIInferior().setSuspended(); MIEvent event = new MIStoppedEvent(session, rr); session.fireEvent(event); } } > in addition to > not knowing the reason (I am not working on CDT but I was explained that missing > "reason" is to blame, and after the patch I proposed I was told things now work > as expected). So, could it be a CDT issue, after all? > @Nick: I think the breakpoint should be reported. The fact that it is temporary > doesn't make it much different than a regular breakpoint... but maybe I'm > missing something. Independent of actually CDT issue, I still think accurately reporting stop reason would be good. Can we probably look at breakpoints 'disp' field and either print "Breakpoint" or "Temporary breakpoint", and likewise either "breakpoint-hit" or "temporary-breakpoint-hit", in breakpoint.c:print_it_typical? - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-10 8:11 ` Vladimir Prus @ 2008-03-10 14:29 ` Aleksandar Ristovski 2008-03-10 14:45 ` Vladimir Prus 0 siblings, 1 reply; 23+ messages in thread From: Aleksandar Ristovski @ 2008-03-10 14:29 UTC (permalink / raw) To: Vladimir Prus; +Cc: gdb-patches, nickrob Vladimir Prus wrote: > The GDB output you have provided above actually includes thread id, so what problem > does CDT have with figuring thread? In fact, CDT4's RxThread.java has the following: > > // We were stopped for some unknown reason, for example > // GDB for temporary breakpoints will not send the > // "reason" ??? still fire a stopped event. > if (list.isEmpty()) { > if (session.getMIInferior().isRunning()) { > session.getMIInferior().setSuspended(); > MIEvent event = new MIStoppedEvent(session, rr); > session.fireEvent(event); > } > } > >> in addition to >> not knowing the reason (I am not working on CDT but I was explained that missing >> "reason" is to blame, and after the patch I proposed I was told things now work >> as expected). > > So, could it be a CDT issue, after all? I believe the problem is that all threads will be reported as suspended, but there is no distinction between the thread that hit the breakpoint and other threads suspended due to stop. Normally, ide will show something like (Breakpoint-hit) beside "Suspended" next to thread number that hit the breakpoint. But I will double check with people working on CDT. > >> @Nick: I think the breakpoint should be reported. The fact that it is temporary >> doesn't make it much different than a regular breakpoint... but maybe I'm >> missing something. > > Independent of actually CDT issue, I still think accurately reporting stop reason > would be good. Can we probably look at breakpoints 'disp' field and either > print "Breakpoint" or "Temporary breakpoint", and likewise either "breakpoint-hit" or > "temporary-breakpoint-hit", in breakpoint.c:print_it_typical? I made the changes, it is not a problem. I have, however, made two versions. The first as suggested by Vladimir, the second slightly different but with the same goal. ------------- version 1 ------------------- CLI: (gdb) tbreak main Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. (gdb) r Starting program: /space/src/testcases/sigsegv/main Temporary breakpoint 1, main () at ./main.c:15 15 foo (p); MI: (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="temporary-breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} --------------------------------------------- But now that I am sifting through testcases to replace all "Breakpoint..." with "Temporary breakpoint..." I am thinking: we need to communicate to the user that the breakpoint is of temporary nature, but should not introduce new "look" or type for the temporary breakpoint. The same applies for the reason, it should still be "breakpoint-hit". This is particularly true for MI. How about this output: -------------------- version 2 ----------------------- CLI: (gdb) tbreak main Breakpoint (temp.) 1 at 0x80483a0: file ./main.c, line 15. (gdb) r Starting program: /space/src/testcases/sigsegv/main Breakpoint (temp.) 1, main () at ./main.c:15 15 foo (p); MI: (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} --------------------------------------------------------- I think the second version would introduce less impact to existing frontends while clarifying the output in a more consistent way. Thoughts? ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-10 14:29 ` Aleksandar Ristovski @ 2008-03-10 14:45 ` Vladimir Prus 2008-03-10 17:18 ` Aleksandar Ristovski 0 siblings, 1 reply; 23+ messages in thread From: Vladimir Prus @ 2008-03-10 14:45 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: gdb-patches, nickrob On Monday 10 March 2008 17:29:05 Aleksandar Ristovski wrote: > Vladimir Prus wrote: > > The GDB output you have provided above actually includes thread id, so what problem > > does CDT have with figuring thread? In fact, CDT4's RxThread.java has the following: > > > > // We were stopped for some unknown reason, for example > > // GDB for temporary breakpoints will not send the > > // "reason" ??? still fire a stopped event. > > if (list.isEmpty()) { > > if (session.getMIInferior().isRunning()) { > > session.getMIInferior().setSuspended(); > > MIEvent event = new MIStoppedEvent(session, rr); > > session.fireEvent(event); > > } > > } > > > >> in addition to > >> not knowing the reason (I am not working on CDT but I was explained that missing > >> "reason" is to blame, and after the patch I proposed I was told things now work > >> as expected). > > > > So, could it be a CDT issue, after all? > > I believe the problem is that all threads will be reported as suspended, but > there is no distinction between the thread that hit the breakpoint and other > threads suspended due to stop. Normally, ide will show something like > (Breakpoint-hit) beside "Suspended" next to thread number that hit the > breakpoint. But I will double check with people working on CDT. > > > > >> @Nick: I think the breakpoint should be reported. The fact that it is temporary > >> doesn't make it much different than a regular breakpoint... but maybe I'm > >> missing something. > > > > Independent of actually CDT issue, I still think accurately reporting stop reason > > would be good. Can we probably look at breakpoints 'disp' field and either > > print "Breakpoint" or "Temporary breakpoint", and likewise either "breakpoint-hit" or > > "temporary-breakpoint-hit", in breakpoint.c:print_it_typical? > > I made the changes, it is not a problem. I have, however, made two versions. The > first as suggested by Vladimir, the second slightly different but with the same > goal. > > ------------- version 1 ------------------- > CLI: > > (gdb) tbreak main > Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. > (gdb) r > Starting program: /space/src/testcases/sigsegv/main > > Temporary breakpoint 1, main () at ./main.c:15 > 15 foo (p); > > MI: > (gdb) > -break-insert -t main > ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} > (gdb) > -exec-run > ^running > (gdb) > *stopped,reason="temporary-breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} > --------------------------------------------- > > But now that I am sifting through testcases to replace all "Breakpoint..." with > "Temporary breakpoint..." I am thinking: we need to communicate to the user that > the breakpoint is of temporary nature, but should not introduce new "look" or > type for the temporary breakpoint. The same applies for the reason, it should > still be "breakpoint-hit". I think that for CLI, it's better to say "Temporary breakpoint hit", since "Temporary" is an important bit of information, and the message gdb print is all that user sees. But whatever CLI output that is acceptable to others is fine with me :-) > This is particularly true for MI. > > How about this output: > *stopped,reason="breakpoint-hit",disp="del" > --------------------------------------------------------- > > I think the second version would introduce less impact to existing frontends > while clarifying the output in a more consistent way. I think this is good. You did not attach your patches, so I cannot comment on the code itself. Also, since this code touches infrun.c and affects CLI, I think some of the global maintainers will have to approve it. - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-10 14:45 ` Vladimir Prus @ 2008-03-10 17:18 ` Aleksandar Ristovski 2008-03-10 17:36 ` Vladimir Prus 0 siblings, 1 reply; 23+ messages in thread From: Aleksandar Ristovski @ 2008-03-10 17:18 UTC (permalink / raw) To: Vladimir Prus; +Cc: gdb-patches, nickrob [-- Attachment #1: Type: text/plain, Size: 2490 bytes --] Vladimir Prus wrote: > > I think this is good. You did not attach your patches, so I cannot comment on > the code itself. Patches attached. > > Also, since this code touches infrun.c and affects CLI, I think some of the > global maintainers will have to approve it. The proposed patch (attached) will produce the following outputs: CLI: (gdb) tbreak main Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. (gdb) r Starting program: /space/src/testcases/sigsegv/main Temporary breakpoint 1, main () at ./main.c:15 15 foo (p); MI: (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} ----- ChangeLog 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> * infrun.c (normal_stop) Move breakpoint_auto_delete further down to allow printing to 'see' real reason of stop. This fixes PR 2424. * breakpoint.c (print_it_typical): Print "Temporary breakpoint" instead of just "Breakpoint" when breakpoint is, well, temporary. (mention): Likewise. ----- testsuite ChangeLog 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> * gdb.base/attach.exp (proc_do_attach_tests): Matching pattern for temporary breakpoint to match "Temporary breakpoint". * gdb.base/break.exp (delete_breakpoints): Likewise. * gdb.base/call-ar-st.exp (get_debug_format): Likewise. * gdb.base/commands.exp (temporary_breakpoint_commands): Likewise. * gdb.base/display.exp: Likewise. * gdb.base/foll-exec.exp (do_exec_tests): Likewise. * gdb.base/restore.exp (restore_tests): Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/watchpoint.exp: Likewise. * gdb.mi/mi-pending.exp: Matching pattern for new "disp" field. * gdb.mi/mi-simplerun.exp (test_running_the_program): Likewise. * gdb.mi/mi-until.exp (test_runnint_to_foo): Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi2-simplerun.exp (test_running_the_program): Likewise. * gdb.mi/mi2-until.exp (test_running_to_foo): Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * lib/gdb.exp (gdb_breakpoint): Likewise. * lib/mi-support.exp: Add "reason" and "disp" fields to the matching pattern. This is to support fix for PR2424. [-- Attachment #2: PR2424.diff --] [-- Type: text/plain, Size: 3010 bytes --] Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.266 diff -u -p -r1.266 infrun.c --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 +++ gdb/infrun.c 10 Mar 2008 15:24:07 -0000 @@ -3151,11 +3151,6 @@ Further execution is probably impossible } } - /* Delete the breakpoint we stopped at, if it wants to be deleted. - Delete any breakpoint that is to be deleted at the next stop. */ - - breakpoint_auto_delete (stop_bpstat); - /* If an auto-display called a function and that got a signal, delete that auto-display to avoid an infinite recursion. */ @@ -3294,6 +3289,9 @@ Further execution is probably impossible done: annotate_stopped (); observer_notify_normal_stop (stop_bpstat); + /* Delete the breakpoint we stopped at, if it wants to be deleted. + Delete any breakpoint that is to be deleted at the next stop. */ + breakpoint_auto_delete (stop_bpstat); } static int Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.304 diff -u -p -r1.304 breakpoint.c --- gdb/breakpoint.c 27 Feb 2008 20:27:49 -0000 1.304 +++ gdb/breakpoint.c 10 Mar 2008 15:24:10 -0000 @@ -2131,6 +2131,7 @@ print_it_typical (bpstat bs) struct breakpoint *b; const struct bp_location *bl; struct ui_stream *stb; + int bp_temp = 0; stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); /* bs->breakpoint_at can be NULL if it was a momentary breakpoint @@ -2144,15 +2145,22 @@ print_it_typical (bpstat bs) { case bp_breakpoint: case bp_hardware_breakpoint: + bp_temp = bs->breakpoint_at->owner->disposition == disp_del; if (bl->address != bl->requested_address) breakpoint_adjustment_warning (bl->requested_address, bl->address, b->number, 1); annotate_breakpoint (b->number); - ui_out_text (uiout, "\nBreakpoint "); + if (bp_temp) + ui_out_text (uiout, "\nTemporary breakpoint "); + else + ui_out_text (uiout, "\nBreakpoint "); if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); + { + ui_out_field_string (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); + ui_out_field_string (uiout, "disp", bp_temp ? "del" : "keep"); + } ui_out_field_int (uiout, "bkptno", b->number); ui_out_text (uiout, ", "); return PRINT_SRC_AND_LOC; @@ -4792,7 +4800,11 @@ mention (struct breakpoint *b) say_where = 0; break; } - printf_filtered (_("Breakpoint %d"), b->number); + if (b->disposition == disp_del) + printf_filtered (_("Temporary breakpoint")); + else + printf_filtered (_("Breakpoint")); + printf_filtered (_(" %d"), b->number); say_where = 1; break; case bp_hardware_breakpoint: [-- Attachment #3: PR2424testsuite.diff --] [-- Type: text/plain, Size: 28820 bytes --] Index: gdb/testsuite/gdb.base/attach.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/attach.exp,v retrieving revision 1.22 diff -u -p -r1.22 attach.exp --- gdb/testsuite/gdb.base/attach.exp 1 Jan 2008 22:53:18 -0000 1.22 +++ gdb/testsuite/gdb.base/attach.exp 10 Mar 2008 17:03:37 -0000 @@ -238,7 +238,7 @@ proc do_attach_tests {} { send_gdb "tbreak 19\n" gdb_expect { - -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { + -re "Temporary breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { pass "after attach2, set tbreak postloop" } -re "$gdb_prompt $" { Index: gdb/testsuite/gdb.base/break.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v retrieving revision 1.32 diff -u -p -r1.32 break.exp --- gdb/testsuite/gdb.base/break.exp 26 Feb 2008 08:14:11 -0000 1.32 +++ gdb/testsuite/gdb.base/break.exp 10 Mar 2008 17:03:37 -0000 @@ -272,13 +272,13 @@ delete_breakpoints # test temporary breakpoint at function # -gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" +gdb_test "tbreak main" "Temporary breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" # # test break at function in file # -gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ +gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$srcfile, line.*" \ "Temporary breakpoint function in file" # @@ -286,25 +286,25 @@ gdb_test "tbreak $srcfile:factorial" "Br # send_gdb "tbreak $bp_location1\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } timeout { fail "breakpoint line number #1 (timeout)" } } -gdb_test "tbreak $bp_location6" "Breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" +gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" # # test break at line number in file # send_gdb "tbreak $srcfile:$bp_location2\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } timeout { fail "Temporary breakpoint line number in file #1 (timeout)" } } set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] -gdb_test "tbreak $srcfile:$bp_location11" "Breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" +gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" # # check to see what breakpoints are set (temporary this time) Index: gdb/testsuite/gdb.base/call-ar-st.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-ar-st.exp,v retrieving revision 1.18 diff -u -p -r1.18 call-ar-st.exp --- gdb/testsuite/gdb.base/call-ar-st.exp 1 Jan 2008 22:53:18 -0000 1.18 +++ gdb/testsuite/gdb.base/call-ar-st.exp 10 Mar 2008 17:03:37 -0000 @@ -109,7 +109,7 @@ get_debug_format #go -until 1209 gdb_test "tbreak 1209" \ - "Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \ + "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \ "tbreakpoint line 1209" gdb_test continue \ @@ -149,7 +149,7 @@ if ![gdb_skip_stdio_test "print_char_arr #go -until 1216 gdb_test "tbreak 1216" \ -"Breakpoint.*file.*$srcfile, line 1216.*" \ +"Temporary breakpoint.*file.*$srcfile, line 1216.*" \ "tbreakpoint line 1216" if ![gdb_skip_stdio_test "continue to 1216"] { @@ -183,7 +183,7 @@ if ![gdb_skip_stdio_test "continue to 12 #set timeout $oldtimeout #go -until 1220 gdb_test "tbreak 1220" \ - "Breakpoint.* file .*$srcfile, line 1220.*" \ + "Temporary breakpoint.* file .*$srcfile, line 1220.*" \ "tbreakpoint line 1220" if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \ @@ -247,7 +247,7 @@ if {![gdb_skip_float_test "print print_d #go -until 1236 gdb_test "tbreak 1236" \ -"Breakpoint.* file .*$srcfile, line 1236.*" \ +"Temporary breakpoint.* file .*$srcfile, line 1236.*" \ "tbreakpoint line 1236" if {![gdb_skip_float_test "continuing to 1236"] && \ @@ -311,7 +311,7 @@ if ![gdb_skip_stdio_test "print print_ar #go -until 1241 gdb_test "tbreak 1241" \ - "Breakpoint..* file .*$srcfile, line 1241.*" \ + "Temporary breakpoint..* file .*$srcfile, line 1241.*" \ "tbreakpoint line 1241" send_gdb "continue\n" @@ -355,7 +355,7 @@ gdb_test "continue" \ #go -until 1281 gdb_test "tbreak 1281" \ - "Breakpoint.* file .*call-ar-st.c, line 1281.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1281.*" \ "tbreakpoint line 1281" if ![gdb_skip_stdio_test "continuing to 1281"] { @@ -443,7 +443,7 @@ if {![gdb_skip_float_test "print print_t #go -until 1286 gdb_test "tbreak 1286" \ - "Breakpoint .* file .*call-ar-st.c, line 1286.*" \ + "Temporary breakpoint .* file .*call-ar-st.c, line 1286.*" \ "tbreakpoint line 1286" gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286" @@ -471,7 +471,7 @@ if { [istarget "hppa*-*-hpux*"] } { # We can't just assume that a "step" will get us into # print_long_arg_list here,either. gdb_test "tbreak print_long_arg_list" \ - "Breakpoint .* file .*call-ar-st.c, line .*" \ + "Temporary breakpoint .* file .*call-ar-st.c, line .*" \ "tbreak in print_long_arg_list after stepping into memcpy" # The short match case below handles cases where a buffer # overflows or something, and expect can't deal with the full @@ -551,7 +551,7 @@ if {![gdb_skip_float_test "print_small_s #go -until 1300 gdb_test "tbreak 1300" \ - "Breakpoint.* file .*call-ar-st.c, line 1300.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1300.*" \ "tbreakpoint line 1300" if ![gdb_skip_stdio_test "continuing to 1300"] { @@ -590,7 +590,7 @@ if ![gdb_skip_stdio_test "continuing to #go -until 1305 gdb_test "tbreak 1305" \ - "Breakpoint.* file .*call-ar-st.c, line 1305.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1305.*" \ "tbreakpoint line 1305" gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \ @@ -650,7 +650,7 @@ if {![gdb_skip_float_test "print print_l #go -until 1311 gdb_test "tbreak 1311" \ - "Breakpoint.* file .*call-ar-st.c, line 1311.*" \ + "Temporary breakpoint.* file .*call-ar-st.c, line 1311.*" \ "tbreakpoint line 1311" gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \ Index: gdb/testsuite/gdb.base/commands.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v retrieving revision 1.21 diff -u -p -r1.21 commands.exp --- gdb/testsuite/gdb.base/commands.exp 1 Jan 2008 22:53:18 -0000 1.21 +++ gdb/testsuite/gdb.base/commands.exp 10 Mar 2008 17:03:37 -0000 @@ -521,7 +521,7 @@ proc temporary_breakpoint_commands {} { # This test will verify that this commands list is executed when the # breakpoint is hit. gdb_test "tbreak factorial" \ - "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ + "Temporary breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ "breakpoint in temporary_breakpoint_commands" send_gdb "commands\n" Index: gdb/testsuite/gdb.base/display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/display.exp,v retrieving revision 1.14 diff -u -p -r1.14 display.exp --- gdb/testsuite/gdb.base/display.exp 1 Jan 2008 22:53:18 -0000 1.14 +++ gdb/testsuite/gdb.base/display.exp 10 Mar 2008 17:03:37 -0000 @@ -165,7 +165,7 @@ gdb_expect { } gdb_test "step" ".*do_vars.*.*27.*" -gdb_test "tbreak 37" ".*Breakpoint 5 a.*" +gdb_test "tbreak 37" ".*breakpoint 5 a.*" gdb_test "cont" ".*do_vars.*37.*37.*" # Beat on printf a bit Index: gdb/testsuite/gdb.base/foll-exec.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/foll-exec.exp,v retrieving revision 1.7 diff -u -p -r1.7 foll-exec.exp --- gdb/testsuite/gdb.base/foll-exec.exp 29 Jan 2008 22:47:20 -0000 1.7 +++ gdb/testsuite/gdb.base/foll-exec.exp 10 Mar 2008 17:03:37 -0000 @@ -283,7 +283,7 @@ proc do_exec_tests {} { # send_gdb "tbreak 27\n" gdb_expect { - -re "Breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\ {pass "prepare to jump to execl call"} -re "$gdb_prompt $" {fail "prepare to jump to execl call"} timeout {fail "(timeout) prepare to jump to execl call"} @@ -343,7 +343,7 @@ proc do_exec_tests {} { # send_gdb "tbreak 41\n" gdb_expect { - -re "Breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\ {pass "prepare to jump to execv call"} -re "$gdb_prompt $" {fail "prepare to jump to execv call"} timeout {fail "(timeout) prepare to jump to execv call"} Index: gdb/testsuite/gdb.base/restore.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/restore.exp,v retrieving revision 1.11 diff -u -p -r1.11 restore.exp --- gdb/testsuite/gdb.base/restore.exp 1 Jan 2008 22:53:19 -0000 1.11 +++ gdb/testsuite/gdb.base/restore.exp 10 Mar 2008 17:03:37 -0000 @@ -54,7 +54,7 @@ proc restore_tests { } { for {set c 1} {$c <= $limit} {incr c} { # Set a breakpoint at the next caller function. - gdb_test "tbreak caller$c" "Breakpoint.*\[0-9\]*\\." \ + gdb_test "tbreak caller$c" "Temporary breakpoint.*\[0-9\]*\\." \ "tbreak caller$c" # Continue to the next caller function. @@ -63,7 +63,7 @@ proc restore_tests { } { # Do each callee function. for {set e 1} {$e <= $limit} {incr e} { - gdb_test "tbreak callee$e" "Breakpoint.*\[0-9\]*\\." \ + gdb_test "tbreak callee$e" "Temporary breakpoint.*\[0-9\]*\\." \ "caller$c calls callee$e; tbreak callee" gdb_test "continue" " callee$e prologue .*/" \ Index: gdb/testsuite/gdb.base/sepdebug.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sepdebug.exp,v retrieving revision 1.15 diff -u -p -r1.15 sepdebug.exp --- gdb/testsuite/gdb.base/sepdebug.exp 26 Feb 2008 08:14:11 -0000 1.15 +++ gdb/testsuite/gdb.base/sepdebug.exp 10 Mar 2008 17:03:37 -0000 @@ -261,13 +261,13 @@ delete_breakpoints # test temporary breakpoint at function # -gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" +gdb_test "tbreak main" "Temporary breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" # # test break at function in file # -gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ +gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$srcfile, line.*" \ "Temporary breakpoint function in file" # @@ -275,25 +275,25 @@ gdb_test "tbreak $srcfile:factorial" "Br # send_gdb "tbreak $bp_location1\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } timeout { fail "breakpoint line number #1 (timeout)" } } -gdb_test "tbreak $bp_location6" "Breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" +gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" # # test break at line number in file # send_gdb "tbreak $srcfile:$bp_location2\n" gdb_expect { - -re "Breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } + -re "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } timeout { fail "Temporary breakpoint line number in file #1 (timeout)" } } set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] -gdb_test "tbreak $srcfile:$bp_location11" "Breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" +gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" # # check to see what breakpoints are set (temporary this time) Index: gdb/testsuite/gdb.base/watchpoint.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v retrieving revision 1.17 diff -u -p -r1.17 watchpoint.exp --- gdb/testsuite/gdb.base/watchpoint.exp 3 Mar 2008 13:24:12 -0000 1.17 +++ gdb/testsuite/gdb.base/watchpoint.exp 10 Mar 2008 17:03:37 -0000 @@ -606,7 +606,7 @@ proc test_complex_watchpoint {} { # local to a recursing function should be bound only to that # one invocation, and should not trigger for other invocations. # - gdb_test "tbreak recurser" ".*Breakpoint.*" + gdb_test "tbreak recurser" ".*breakpoint.*" gdb_test "cont" "Continuing.*recurser.*" gdb_test "watch local_x" ".*\[Ww\]atchpoint \[0-9\]*: local_x" \ "set local watch in recursive call" Index: gdb/testsuite/gdb.mi/mi-pending.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pending.exp,v retrieving revision 1.3 diff -u -p -r1.3 mi-pending.exp --- gdb/testsuite/gdb.mi/mi-pending.exp 26 Feb 2008 08:14:11 -0000 1.3 +++ gdb/testsuite/gdb.mi/mi-pending.exp 10 Mar 2008 17:03:37 -0000 @@ -71,5 +71,5 @@ mi_run_cmd # Make sure we hit breakpoint. mi_gdb_test "" \ - ".*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\".*func=\"pendfunc1\".*" \ - "Run till MI pending breakpoint on pendfunc1" \ No newline at end of file + ".*\\*stopped,reason=\"breakpoint-hit\",disp=\".*\",bkptno=\"1\".*func=\"pendfunc1\".*" \ + "Run till MI pending breakpoint on pendfunc1" Index: gdb/testsuite/gdb.mi/mi-simplerun.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v retrieving revision 1.18 diff -u -p -r1.18 mi-simplerun.exp --- gdb/testsuite/gdb.mi/mi-simplerun.exp 27 Feb 2008 20:29:31 -0000 1.18 +++ gdb/testsuite/gdb.mi/mi-simplerun.exp 10 Mar 2008 17:03:37 -0000 @@ -114,7 +114,7 @@ proc test_running_the_program {} { # The following is equivalent to a send_gdb "000-exec-run\n" mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_main_body\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",disp=\".*\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_main_body\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" { Index: gdb/testsuite/gdb.mi/mi-until.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v retrieving revision 1.15 diff -u -p -r1.15 mi-until.exp --- gdb/testsuite/gdb.mi/mi-until.exp 1 Jan 2008 22:53:20 -0000 1.15 +++ gdb/testsuite/gdb.mi/mi-until.exp 10 Mar 2008 17:03:37 -0000 @@ -57,7 +57,7 @@ proc test_running_to_foo {} { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" { Index: gdb/testsuite/gdb.mi/mi-var-display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v retrieving revision 1.21 diff -u -p -r1.21 mi-var-display.exp --- gdb/testsuite/gdb.mi/mi-var-display.exp 23 Jan 2008 06:20:57 -0000 1.21 +++ gdb/testsuite/gdb.mi/mi-var-display.exp 10 Mar 2008 17:03:37 -0000 @@ -49,7 +49,7 @@ mi_gdb_test "200-break-insert $srcfile:$ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" { pass "run to do_children_tests" } -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} @@ -333,7 +333,7 @@ mi_gdb_test "200-break-insert do_special send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" { pass "continue to do_special_tests" } timeout { @@ -593,10 +593,10 @@ mi_gdb_test "200-break-insert incr_a" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" { pass "continue to incr_a" } - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" { fail "continue to incr_a (compiler debug info incorrect)" } -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" { Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v retrieving revision 1.9 diff -u -p -r1.9 mi2-simplerun.exp --- gdb/testsuite/gdb.mi/mi2-simplerun.exp 27 Feb 2008 20:29:31 -0000 1.9 +++ gdb/testsuite/gdb.mi/mi2-simplerun.exp 10 Mar 2008 17:03:37 -0000 @@ -114,7 +114,7 @@ proc test_running_the_program {} { # The following is equivalent to a send_gdb "000-exec-run\n" mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_main_body\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",disp=\".*\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_main_body\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" { Index: gdb/testsuite/gdb.mi/mi2-until.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v retrieving revision 1.9 diff -u -p -r1.9 mi2-until.exp --- gdb/testsuite/gdb.mi/mi2-until.exp 1 Jan 2008 22:53:20 -0000 1.9 +++ gdb/testsuite/gdb.mi/mi2-until.exp 10 Mar 2008 17:03:37 -0000 @@ -58,7 +58,7 @@ proc test_running_to_foo {} { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" { Index: gdb/testsuite/gdb.mi/mi2-var-display.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v retrieving revision 1.14 diff -u -p -r1.14 mi2-var-display.exp --- gdb/testsuite/gdb.mi/mi2-var-display.exp 23 Jan 2008 21:05:16 -0000 1.14 +++ gdb/testsuite/gdb.mi/mi2-var-display.exp 10 Mar 2008 17:03:37 -0000 @@ -49,7 +49,7 @@ mi_gdb_test "200-break-insert $srcfile:$ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" { pass "run to do_children_tests" } -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} @@ -333,7 +333,7 @@ mi_gdb_test "200-break-insert do_special send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" { pass "continue to do_special_tests" } timeout { @@ -593,10 +593,10 @@ mi_gdb_test "200-break-insert incr_a" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" { pass "continue to incr_a" } - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" { fail "continue to incr_a (compiler debug info incorrect)" } -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" { Index: gdb/testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.96 diff -u -p -r1.96 gdb.exp --- gdb/testsuite/lib/gdb.exp 23 Jan 2008 06:20:34 -0000 1.96 +++ gdb/testsuite/lib/gdb.exp 10 Mar 2008 17:03:39 -0000 @@ -337,17 +337,19 @@ proc gdb_breakpoint { function args } { } set break_command "break" + set break_message "Breakpoint" if {[lsearch -exact [lindex $args 0] temporary] != -1} { set break_command "tbreak" + set break_message "Temporary breakpoint" } send_gdb "$break_command $function\n" # The first two regexps are what we get with -g, the third is without -g. gdb_expect 30 { - -re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} - -re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {} - -re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {} - -re "Breakpoint \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { + -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} + -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {} + -re "$break_message \[0-9\]* at .*$gdb_prompt $" {} + -re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { if {$pending_response == "n"} { fail "setting breakpoint at $function" return 0 Index: gdb/testsuite/lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.51 diff -u -p -r1.51 mi-support.exp --- gdb/testsuite/lib/mi-support.exp 29 Jan 2008 19:36:58 -0000 1.51 +++ gdb/testsuite/lib/mi-support.exp 10 Mar 2008 17:03:39 -0000 @@ -890,7 +890,7 @@ proc mi_runto_helper {func run_or_contin } gdb_expect { - -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re ".*000\\*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"$decimal\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-10 17:18 ` Aleksandar Ristovski @ 2008-03-10 17:36 ` Vladimir Prus 2008-03-10 18:50 ` Aleksandar Ristovski 0 siblings, 1 reply; 23+ messages in thread From: Vladimir Prus @ 2008-03-10 17:36 UTC (permalink / raw) To: Aleksandar Ristovski; +Cc: gdb-patches, nickrob On Monday 10 March 2008 20:18:06 Aleksandar Ristovski wrote: > Vladimir Prus wrote: > > > > I think this is good. You did not attach your patches, so I cannot comment on > > the code itself. > Patches attached. > > > > Also, since this code touches infrun.c and affects CLI, I think some of the > > global maintainers will have to approve it. > > The proposed patch (attached) will produce the following outputs: > > CLI: > (gdb) tbreak main > Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. > (gdb) r > Starting program: /space/src/testcases/sigsegv/main > > Temporary breakpoint 1, main () at ./main.c:15 > 15 foo (p); > > MI: > (gdb) > -break-insert -t main > ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} > (gdb) > -exec-run > ^running > (gdb) > *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} > > > > > ----- ChangeLog > 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> > > * infrun.c (normal_stop) Move breakpoint_auto_delete further down > to allow printing to 'see' real reason of stop. This fixes PR 2424. > * breakpoint.c (print_it_typical): Print "Temporary breakpoint" instead > of just "Breakpoint" when breakpoint is, well, temporary. > (mention): Likewise. > > ----- testsuite ChangeLog > 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> > > * gdb.base/attach.exp (proc_do_attach_tests): Matching pattern for > temporary breakpoint to match "Temporary breakpoint". > * gdb.base/break.exp (delete_breakpoints): Likewise. > * gdb.base/call-ar-st.exp (get_debug_format): Likewise. > * gdb.base/commands.exp (temporary_breakpoint_commands): Likewise. > * gdb.base/display.exp: Likewise. > * gdb.base/foll-exec.exp (do_exec_tests): Likewise. > * gdb.base/restore.exp (restore_tests): Likewise. > * gdb.base/sepdebug.exp: Likewise. > * gdb.base/watchpoint.exp: Likewise. > * gdb.mi/mi-pending.exp: Matching pattern for new "disp" field. > * gdb.mi/mi-simplerun.exp (test_running_the_program): Likewise. > * gdb.mi/mi-until.exp (test_runnint_to_foo): Likewise. > * gdb.mi/mi-var-display.exp: Likewise. > * gdb.mi/mi2-simplerun.exp (test_running_the_program): Likewise. > * gdb.mi/mi2-until.exp (test_running_to_foo): Likewise. > * gdb.mi/mi2-var-display.exp: Likewise. > * lib/gdb.exp (gdb_breakpoint): Likewise. > * lib/mi-support.exp: Add "reason" and "disp" fields to the matching > pattern. This is to support fix for PR2424. > > > PR2424.diff > Index: gdb/infrun.c > =================================================================== > RCS file: /cvs/src/src/gdb/infrun.c,v > retrieving revision 1.266 > diff -u -p -r1.266 infrun.c > --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 > +++ gdb/infrun.c 10 Mar 2008 15:24:07 -0000 > @@ -3151,11 +3151,6 @@ Further execution is probably impossible > } > } > > - /* Delete the breakpoint we stopped at, if it wants to be deleted. > - Delete any breakpoint that is to be deleted at the next stop. */ > - > - breakpoint_auto_delete (stop_bpstat); > - > /* If an auto-display called a function and that got a signal, > delete that auto-display to avoid an infinite recursion. */ > > @@ -3294,6 +3289,9 @@ Further execution is probably impossible > done: > annotate_stopped (); > observer_notify_normal_stop (stop_bpstat); > + /* Delete the breakpoint we stopped at, if it wants to be deleted. > + Delete any breakpoint that is to be deleted at the next stop. */ > + breakpoint_auto_delete (stop_bpstat); > } > > static int > Index: gdb/breakpoint.c > =================================================================== > RCS file: /cvs/src/src/gdb/breakpoint.c,v > retrieving revision 1.304 > diff -u -p -r1.304 breakpoint.c > --- gdb/breakpoint.c 27 Feb 2008 20:27:49 -0000 1.304 > +++ gdb/breakpoint.c 10 Mar 2008 15:24:10 -0000 > @@ -2131,6 +2131,7 @@ print_it_typical (bpstat bs) > struct breakpoint *b; > const struct bp_location *bl; > struct ui_stream *stb; > + int bp_temp = 0; > stb = ui_out_stream_new (uiout); > old_chain = make_cleanup_ui_out_stream_delete (stb); > /* bs->breakpoint_at can be NULL if it was a momentary breakpoint > @@ -2144,15 +2145,22 @@ print_it_typical (bpstat bs) > { > case bp_breakpoint: > case bp_hardware_breakpoint: > + bp_temp = bs->breakpoint_at->owner->disposition == disp_del; > if (bl->address != bl->requested_address) > breakpoint_adjustment_warning (bl->requested_address, > bl->address, > b->number, 1); > annotate_breakpoint (b->number); > - ui_out_text (uiout, "\nBreakpoint "); > + if (bp_temp) > + ui_out_text (uiout, "\nTemporary breakpoint "); > + else > + ui_out_text (uiout, "\nBreakpoint "); > if (ui_out_is_mi_like_p (uiout)) > - ui_out_field_string (uiout, "reason", > - async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); > + { > + ui_out_field_string (uiout, "reason", > + async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); > + ui_out_field_string (uiout, "disp", bp_temp ? "del" : "keep"); > + } For consistency, it's better to use same printing of 'disp' as done in print_one_breakpoint_location: ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); bpdisps is actually a table local to print_one_breakpoint_location, but there's no reason why it cannot be made a global table. - Volodya ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [patch] fix for PR2424 2008-03-10 17:36 ` Vladimir Prus @ 2008-03-10 18:50 ` Aleksandar Ristovski 0 siblings, 0 replies; 23+ messages in thread From: Aleksandar Ristovski @ 2008-03-10 18:50 UTC (permalink / raw) To: Vladimir Prus; +Cc: gdb-patches, nickrob [-- Attachment #1: Type: text/plain, Size: 2219 bytes --] Vladimir Prus wrote: > On Monday 10 March 2008 20:18:06 Aleksandar Ristovski wrote: >> Vladimir Prus wrote: >> The proposed patch (attached) will produce the following outputs: >> >> CLI: >> (gdb) tbreak main >> Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. >> (gdb) r >> Starting program: /space/src/testcases/sigsegv/main >> >> Temporary breakpoint 1, main () at ./main.c:15 >> 15 foo (p); >> >> MI: >> (gdb) >> -break-insert -t main >> ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} >> (gdb) >> -exec-run >> ^running >> (gdb) >> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} >> > > For consistency, it's better to use same printing of 'disp' as done > in print_one_breakpoint_location: > > ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); > > bpdisps is actually a table local to print_one_breakpoint_location, > but there's no reason why it cannot be made a global table. > > - Volodya > New diff for code (testsuite remains the same as in previous email). Static array bpstats moved to new function bpstat_text and function used. Note: I believe docs need also be changed since in the examples for mi protocol there are no 'disp' fields. But I am not sure where do I need to make those changes. 2008-03-10 Aleksandar Ristovski <aristovski@qnx.com> * infrun.c (normal_stop) Move breakpoint_auto_delete further down to allow printing to 'see' real reason of stop. This fixes PR 2424. * breakpoint.c (bpdisp_texst): New function. The function takes over the role of bpstats static array in print_one_breakpoint_location. (print_it_typical): Print "Temporary breakpoint" instead of just "Breakpoint" when breakpoint is, well, temporary. For mi-like protocols, print disp field. (print_one_breakpoint_location): Removed bpdisps static definition. Call new bpstat_text function to get value for 'disp' field. (mention): Print "Temporary breakpoint" instead of just "Breakpoint". [-- Attachment #2: PR2424.diff --] [-- Type: text/plain, Size: 4247 bytes --] Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.266 diff -u -p -r1.266 infrun.c --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 +++ gdb/infrun.c 10 Mar 2008 18:40:15 -0000 @@ -3151,11 +3151,6 @@ Further execution is probably impossible } } - /* Delete the breakpoint we stopped at, if it wants to be deleted. - Delete any breakpoint that is to be deleted at the next stop. */ - - breakpoint_auto_delete (stop_bpstat); - /* If an auto-display called a function and that got a signal, delete that auto-display to avoid an infinite recursion. */ @@ -3294,6 +3289,9 @@ Further execution is probably impossible done: annotate_stopped (); observer_notify_normal_stop (stop_bpstat); + /* Delete the breakpoint we stopped at, if it wants to be deleted. + Delete any breakpoint that is to be deleted at the next stop. */ + breakpoint_auto_delete (stop_bpstat); } static int Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.304 diff -u -p -r1.304 breakpoint.c --- gdb/breakpoint.c 27 Feb 2008 20:27:49 -0000 1.304 +++ gdb/breakpoint.c 10 Mar 2008 18:40:17 -0000 @@ -210,8 +210,16 @@ unlink_locations_from_global_list (struc static int is_hardware_watchpoint (struct breakpoint *bpt); -/* Prototypes for exported functions. */ +static const char * +bpdisp_text (enum bpdisp disp) +{ + /* NOTE: the following values are a part of MI protocol and represent + values of 'disp' field returned when inferior stops at a breakpoint. */ + static char *bpdisps[] = {"del", "dstp", "dis", "keep"}; + return bpdisps[(int) disp]; +} +/* Prototypes for exported functions. */ /* If FALSE, gdb will not use hardware support for watchpoints, even if such is available. */ static int can_use_hw_watchpoints; @@ -2131,6 +2139,7 @@ print_it_typical (bpstat bs) struct breakpoint *b; const struct bp_location *bl; struct ui_stream *stb; + int bp_temp = 0; stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); /* bs->breakpoint_at can be NULL if it was a momentary breakpoint @@ -2144,15 +2153,22 @@ print_it_typical (bpstat bs) { case bp_breakpoint: case bp_hardware_breakpoint: + bp_temp = bs->breakpoint_at->owner->disposition == disp_del; if (bl->address != bl->requested_address) breakpoint_adjustment_warning (bl->requested_address, bl->address, b->number, 1); annotate_breakpoint (b->number); - ui_out_text (uiout, "\nBreakpoint "); + if (bp_temp) + ui_out_text (uiout, "\nTemporary breakpoint "); + else + ui_out_text (uiout, "\nBreakpoint "); if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); + { + ui_out_field_string (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); + ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition)); + } ui_out_field_int (uiout, "bkptno", b->number); ui_out_text (uiout, ", "); return PRINT_SRC_AND_LOC; @@ -3362,8 +3378,6 @@ print_one_breakpoint_location (struct br {bp_catch_exec, "catch exec"} }; - static char *bpdisps[] = - {"del", "dstp", "dis", "keep"}; static char bpenables[] = "nynny"; char wrap_indent[80]; struct ui_stream *stb = ui_out_stream_new (uiout); @@ -3420,7 +3434,7 @@ print_one_breakpoint_location (struct br if (part_of_multiple) ui_out_field_skip (uiout, "disp"); else - ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); + ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition)); /* 4 */ @@ -4792,7 +4806,11 @@ mention (struct breakpoint *b) say_where = 0; break; } - printf_filtered (_("Breakpoint %d"), b->number); + if (b->disposition == disp_del) + printf_filtered (_("Temporary breakpoint")); + else + printf_filtered (_("Breakpoint")); + printf_filtered (_(" %d"), b->number); say_where = 1; break; case bp_hardware_breakpoint: ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2008-04-23 13:53 UTC | newest] Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-04-15 15:31 [patch] fix for PR2424 Aleksandar Ristovski -- strict thread matches above, loose matches on Subject: below -- 2008-04-23 17:48 Aleksandar Ristovski 2008-04-23 17:49 ` Vladimir Prus 2008-04-16 18:28 Aleksandar Ristovski 2008-04-15 15:07 Aleksandar Ristovski 2008-04-15 15:25 ` Daniel Jacobowitz 2008-04-16 13:17 ` Vladimir Prus 2008-04-23 11:16 ` Vladimir Prus 2008-04-14 15:16 Aleksandar Ristovski 2008-04-14 18:06 ` Daniel Jacobowitz 2008-04-01 19:41 Aleksandar Ristovski 2008-03-05 17:36 Aleksandar Ristovski 2008-03-08 11:31 ` Nick Roberts 2008-03-08 18:36 ` Vladimir Prus 2008-03-09 0:12 ` Aleksandar Ristovski 2008-03-09 3:32 ` Nick Roberts 2008-03-09 4:55 ` Aleksandar Ristovski 2008-03-10 8:11 ` Vladimir Prus 2008-03-10 14:29 ` Aleksandar Ristovski 2008-03-10 14:45 ` Vladimir Prus 2008-03-10 17:18 ` Aleksandar Ristovski 2008-03-10 17:36 ` Vladimir Prus 2008-03-10 18:50 ` Aleksandar Ristovski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox