Home | History | Annotate | Line # | Download | only in gdb.arch
      1 # Copyright 2019-2024 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 
     24 require is_aarch64_target
     25 
     26 standard_testfile .c
     27 
     28 if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     29     return
     30 }
     31 
     32 runto_main
     33 set test "continue to exit"
     34 gdb_test_multiple "continue" "$test" {
     35     -re "exited with code 01.*$gdb_prompt $" {
     36         # For case that the PTRACE_SETREGSET call fails.
     37         pass "$test"
     38     }
     39     -re "exited normally.*$gdb_prompt $" {
     40         pass "$test"
     41     }
     42 }
     43