|
| 1 | +# Copyright 2022-2023 Free Software Foundation, Inc. |
| 2 | + |
| 3 | +# This program is free software; you can redistribute it and/or modify |
| 4 | +# it under the terms of the GNU General Public License as published by |
| 5 | +# the Free Software Foundation; either version 3 of the License, or |
| 6 | +# (at your option) any later version. |
| 7 | +# |
| 8 | +# This program is distributed in the hope that it will be useful, |
| 9 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | +# GNU General Public License for more details. |
| 12 | +# |
| 13 | +# You should have received a copy of the GNU General Public License |
| 14 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | + |
| 16 | +# Create a multi-location breakpoint with a thread condition, then check the |
| 17 | +# output of 'info breakpoints' to ensure that the thread condition is |
| 18 | +# displayed correctly. |
| 19 | + |
| 20 | +standard_testfile |
| 21 | + |
| 22 | +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { |
| 23 | + return -1 |
| 24 | +} |
| 25 | + |
| 26 | +if {![runto_main]} { |
| 27 | + return -1 |
| 28 | +} |
| 29 | + |
| 30 | +delete_breakpoints |
| 31 | + |
| 32 | +gdb_breakpoint "foo thread 1" |
| 33 | +set bp_number [get_integer_valueof "\$bpnum" 0] |
| 34 | +if { $bp_number == 0 } { |
| 35 | + unresolved "breakpoint not placed correctly" |
| 36 | + return -1 |
| 37 | +} |
| 38 | + |
| 39 | +set saw_header false |
| 40 | +set saw_cond false |
| 41 | +set loc_count 0 |
| 42 | +gdb_test_multiple "info breakpoints" \ |
| 43 | + "check thread condition is displayed correctly" { |
| 44 | + -re "\r\nNum\\s+\[^\r\n\]+\r\n" { |
| 45 | + exp_continue |
| 46 | + } |
| 47 | + |
| 48 | + -re "^$bp_number\\s+breakpoint\\s+keep\\s+y\\s+<MULTIPLE>\\s*\r\n" { |
| 49 | + set saw_header true |
| 50 | + exp_continue |
| 51 | + } |
| 52 | + |
| 53 | + -re "^\\s+stop only in thread 1\r\n" { |
| 54 | + set saw_cond true |
| 55 | + exp_continue |
| 56 | + } |
| 57 | + |
| 58 | + -re "^$bp_number\\.\[123\]\\s+\[^\r\n\]+:${decimal}\r\n" { |
| 59 | + incr loc_count |
| 60 | + exp_continue |
| 61 | + } |
| 62 | + |
| 63 | + -re "^$gdb_prompt $" { |
| 64 | + gdb_assert { $saw_header && $saw_cond && $loc_count == 3} \ |
| 65 | + $gdb_test_name |
| 66 | + } |
| 67 | +} |
0 commit comments