|
| 1 | +# Copyright 2015 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 | +if { [is_remote target] || ![isnative] } then { |
| 17 | + continue |
| 18 | +} |
| 19 | + |
| 20 | +set testfile "gdb-rhbz1149205-catch-syscall-fork" |
| 21 | +set srcfile ${testfile}.c |
| 22 | +set binfile [standard_output_file ${testfile}] |
| 23 | + |
| 24 | +# Until "catch syscall" is implemented on other targets... |
| 25 | +if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { |
| 26 | + continue |
| 27 | +} |
| 28 | + |
| 29 | +# This shall be updated whenever 'catch syscall' is implemented |
| 30 | +# on some architecture. |
| 31 | +#if { ![istarget "i\[34567\]86-*-linux*"] |
| 32 | +if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] |
| 33 | + && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] |
| 34 | + && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { |
| 35 | + continue |
| 36 | +} |
| 37 | + |
| 38 | +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
| 39 | + untested ${testfile}.exp |
| 40 | + return -1 |
| 41 | +} |
| 42 | + |
| 43 | +gdb_exit |
| 44 | +gdb_start |
| 45 | +gdb_reinitialize_dir $srcdir/$subdir |
| 46 | +gdb_load $binfile |
| 47 | + |
| 48 | +if { ![runto_main] } { |
| 49 | + return -1 |
| 50 | +} |
| 51 | + |
| 52 | +gdb_test "catch syscall chdir" \ |
| 53 | + "Catchpoint $decimal \\\(syscall (.)?chdir(.)? \\\[$decimal\\\]\\\)" \ |
| 54 | + "catch syscall chdir" |
| 55 | + |
| 56 | +gdb_test "continue" \ |
| 57 | + "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ |
| 58 | + "continue from catch syscall after fork" |
0 commit comments