1# Copyright 2019 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# Make sure that the inferior doesn't assert and exits successfully. 17# 18# This test checks that GDB does not alter watchpoints set by an inferior. 19# It sets a watchpoint on memory then writes to the watched memory. 20# It will exit with 2 if the watchpoint is not reached. 21# 22# See PR breakpoints/21870. 23 24if {![is_aarch64_target]} { 25 verbose "Skipping ${gdb_test_file_name}." 26 return 27} 28 29standard_testfile .c 30 31if { [prepare_for_testing "failed to prepare" ${testfile}] } { 32 return 33} 34 35runto_main 36set test "continue to exit" 37gdb_test_multiple "continue" "$test" { 38 -re "exited with code 01.*$gdb_prompt $" { 39 # For case that the PTRACE_SETREGSET call fails. 40 pass "$test" 41 } 42 -re "exited normally.*$gdb_prompt $" { 43 pass "$test" 44 } 45} 46