[gdb/syscalls] Sync with strace v6.13
[binutils-gdb.git] / gdb / testsuite / gdb.base / bp-cmds-run-with-ex.exp
blob62dd97aadf318e5a3179f60531dc8a7da04429e8
1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2020-2024 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 # Test that breakpoint commands are taken into account when the
19 # debuggee program is executed with a "run" command given through the
20 # '-ex' option.
22 standard_testfile
24 if {[build_executable "failed to prepare" $testfile $srcfile]} {
25     return -1
28 set script_file $srcdir/$subdir/$testfile.gdb
30 save_vars { GDBFLAGS } {
31     append GDBFLAGS " -x ${script_file}"
32     append GDBFLAGS " -ex run"
33     append GDBFLAGS " --args ${binfile}"
35     gdb_exit
36     if {[gdb_spawn] != 0} {
37         fail "spawn gdb"
38         return -1
39     }
42 gdb_test_multiple "" "execute bp commands" {
43     -re " = 123\r\n$gdb_prompt $" {
44         pass $gdb_test_name
45     }
46     -re "Don't know how to run.*$gdb_prompt $" {
47         unsupported $gdb_test_name
48     }