| OLD | NEW |
| 1 # Copyright (C) 1996-1997, 1999-2004, 2007-2012 Free Software | 1 # Copyright (C) 1996-2013 Free Software Foundation, Inc. |
| 2 # Foundation, Inc. | |
| 3 | 2 |
| 4 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 6 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 7 # (at your option) any later version. | 6 # (at your option) any later version. |
| 8 # | 7 # |
| 9 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 72 |
| 74 set return_me 1 | 73 set return_me 1 |
| 75 | 74 |
| 76 gdb_test_multiple "continue" "continue until common routine run 15 times" { | 75 gdb_test_multiple "continue" "continue until common routine run 15 times" { |
| 77 -re "Continuing.*common_routine.*at.*$srcfile.*$gdb_prompt $" { | 76 -re "Continuing.*common_routine.*at.*$srcfile.*$gdb_prompt $" { |
| 78 set return_me 0 | 77 set return_me 0 |
| 79 } | 78 } |
| 80 } | 79 } |
| 81 | 80 |
| 82 if { $return_me == 1 } then { | 81 if { $return_me == 1 } then { |
| 83 » return 0; | 82 » return 0 |
| 84 } | 83 } |
| 85 | 84 |
| 86 # Check that we stopped when we actually expected to stop, by | 85 # Check that we stopped when we actually expected to stop, by |
| 87 # verifying that there have been 15 previous hits. | 86 # verifying that there have been 15 previous hits. |
| 88 | 87 |
| 89 # NOTE: Because of synchronization behavior, it is possible for | 88 # NOTE: Because of synchronization behavior, it is possible for |
| 90 # more than one thread to increment "hits" between one breakpoint | 89 # more than one thread to increment "hits" between one breakpoint |
| 91 # trap and the next. So stopping after 16 or 17 hits should be | 90 # trap and the next. So stopping after 16 or 17 hits should be |
| 92 # considered acceptable. | 91 # considered acceptable. |
| 93 | 92 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 -re ".*Thread.*main.*$gdb_prompt $" { | 132 -re ".*Thread.*main.*$gdb_prompt $" { |
| 134 pass "info threads" | 133 pass "info threads" |
| 135 set return_me 0 | 134 set return_me 0 |
| 136 } | 135 } |
| 137 -re "\r\n$gdb_prompt $" { | 136 -re "\r\n$gdb_prompt $" { |
| 138 unsupported "gdb does not support pthreads for this machine" | 137 unsupported "gdb does not support pthreads for this machine" |
| 139 } | 138 } |
| 140 } | 139 } |
| 141 | 140 |
| 142 if { $return_me == 1 } then { | 141 if { $return_me == 1 } then { |
| 143 » return 0; | 142 » return 0 |
| 144 } | 143 } |
| 145 | 144 |
| 146 # Extract the thread id number of main thread from "info threads" output. | 145 # Extract the thread id number of main thread from "info threads" output. |
| 147 gdb_test_multiple "info threads" "get main thread id" { | 146 gdb_test_multiple "info threads" "get main thread id" { |
| 148 -re "(\[0-9\]+)(${horiz}Thread${horiz}main.*)($gdb_prompt $)" { | 147 -re "(\[0-9\]+)(${horiz}Thread${horiz}main.*)($gdb_prompt $)" { |
| 149 } | 148 } |
| 150 } | 149 } |
| 151 | 150 |
| 152 set main_id $expect_out(1,string) | 151 set main_id $expect_out(1,string) |
| 153 | 152 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 set description "Stopped with a ^C" | 202 set description "Stopped with a ^C" |
| 204 gdb_expect { | 203 gdb_expect { |
| 205 -re "Program received signal SIGINT.*$gdb_prompt $" { | 204 -re "Program received signal SIGINT.*$gdb_prompt $" { |
| 206 pass $description | 205 pass $description |
| 207 } | 206 } |
| 208 -re "Quit.*$gdb_prompt $" { | 207 -re "Quit.*$gdb_prompt $" { |
| 209 pass $description | 208 pass $description |
| 210 } | 209 } |
| 211 timeout { | 210 timeout { |
| 212 fail "$description (timeout)" | 211 fail "$description (timeout)" |
| 213 » return 1; | 212 » return 1 |
| 214 } | 213 } |
| 215 } | 214 } |
| 216 gdb_test "bt" ".*" | 215 gdb_test "bt" ".*" |
| 217 | 216 |
| 218 # Verify that all threads can be run again after a ^C stop. | 217 # Verify that all threads can be run again after a ^C stop. |
| 219 if [all_threads_running] then { | 218 if [all_threads_running] then { |
| 220 pass "All threads running after continuing from ^C stop" | 219 pass "All threads running after continuing from ^C stop" |
| 221 } | 220 } |
| 222 return 0; | 221 return 0 |
| 223 } | 222 } |
| 224 | 223 |
| 225 proc check_backtraces {} { | 224 proc check_backtraces {} { |
| 226 global gdb_prompt main_id thread1_id thread2_id | 225 global gdb_prompt main_id thread1_id thread2_id |
| 227 | 226 |
| 228 # Check that the "thread apply N backtrace" command works | 227 # Check that the "thread apply N backtrace" command works |
| 229 | 228 |
| 230 gdb_test "thread apply $main_id backtrace" \ | 229 gdb_test "thread apply $main_id backtrace" \ |
| 231 ".* in main \\(argc=.*, argv=.*\\).*" \ | 230 ".* in main \\(argc=.*, argv=.*\\).*" \ |
| 232 "check backtrace from main thread" | 231 "check backtrace from main thread" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 265 } |
| 267 } | 266 } |
| 268 } | 267 } |
| 269 | 268 |
| 270 setup_xfail "alpha-*-osf*" | 269 setup_xfail "alpha-*-osf*" |
| 271 if [runto_main] then { | 270 if [runto_main] then { |
| 272 clear_xfail "alpha-*-osf*" | 271 clear_xfail "alpha-*-osf*" |
| 273 if [test_startup] then { | 272 if [test_startup] then { |
| 274 if [check_control_c] then { | 273 if [check_control_c] then { |
| 275 warning "Could not stop child with ^C; skipping rest of tests.\n" | 274 warning "Could not stop child with ^C; skipping rest of tests.\n" |
| 276 » return; | 275 » return |
| 277 } | 276 } |
| 278 check_backtraces | 277 check_backtraces |
| 279 } | 278 } |
| 280 } | 279 } |
| 281 clear_xfail "alpha-*-osf*" | 280 clear_xfail "alpha-*-osf*" |
| OLD | NEW |