Fix zero_ext documentation
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / bp-permanent.exp
index e802eee263d0c03fe86ba6a32bfb4ecd9baf107a..57e36ed294d5225597a7c3295c446e40fa06f3b5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Free Software Foundation, Inc.
+# Copyright (C) 2014-2016 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -104,7 +104,8 @@ proc test {always_inserted sw_watchpoint} {
        # to memory manually.
        set count [expr $address_after_bp - $address_bp]
        for {set i 0} {$i < $count} {incr i} {
-           gdb_test_multiple "p /x addr_bp\[$i\] = buffer\[$i\]" $test {
+           set test "p /x addr_bp\[$i\] = buffer\[$i\]"
+           gdb_test_multiple $test $test {
                -re "Cannot access memory at address $hex.*$gdb_prompt $" {
                    # Some targets (QEMU for one) will disallow writes to the
                    # .text section under certain circumstances.  It is no use
@@ -122,8 +123,21 @@ proc test {always_inserted sw_watchpoint} {
     with_test_prefix "basics" {
        # Run to the permanent breakpoint, just to make sure we've inserted it
        # correctly.
-       gdb_test "continue" "Program received signal SIGTRAP.*" \
-           "permanent breakpoint causes random signal"
+       # If the target fails to stop, the remainder of the test will not work
+       # so just return.  This can happen on some simulator targets where
+       # the running program doesn't see breakpoints that are visible to
+       # the execution engine, or where writes to the .text section are
+       # quietly ignored.
+       set test "permanent breakpoint causes random signal"
+       gdb_test_multiple "continue" $test {
+           -re "exited normally.*$gdb_prompt $" {
+               unsupported "failed to stop at permanent breakpoint"
+               return
+           }
+           -re "Program received signal SIGTRAP.*$gdb_prompt $" {
+               pass $test
+           }
+       }
 
        # Now set a breakpoint on top, thus creating a permanent breakpoint.
        gdb_breakpoint "$line_bp"
This page took 0.026811 seconds and 4 git commands to generate.