+2017-10-13 Pedro Alves <palves@redhat.com>
+
+ * lib/gdb.exp (target_can_use_run_cmd): New procedure.
+ * gdb.base/annota1.exp: Use it instead of is_remote.
+ * gdb.base/annota3.exp: Use it instead of is_remote.
+ * gdb.cp/annota2.exp: Use it instead of is_remote.
+ * gdb.cp/annota3.exp: Use it instead of is_remote.
+ * gdb.multi/bkpt-multi-exec.exp: Use it instead of is_remote.
+
2017-10-13 Pedro Alves <palves@redhat.com>
* gdb.base/testenv.exp: Check use_gdb_stub instead of is_remote.
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
-# are we on a target board? If so, don't run these tests.
-# note: this is necessary because we cannot use runto_main (which would
-# work for remote targets too) because of the different prompt we get
-# when using annotation level 2.
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
#
-if [is_remote target] then {
+if ![target_can_use_run_cmd] {
return 0
}
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
-# are we on a target board? If so, don't run these tests.
-# note: this is necessary because we cannot use runto_main (which would
-# work for remote targets too) because of the different prompt we get
-# when using annotation level 2.
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
#
-if [is_remote target] then {
+if ![target_can_use_run_cmd] {
return 0
}
return -1
}
-# are we on a target board? If so, don't run these tests.
-# note: this is necessary because we cannot use runto_main (which would
-# work for remote targets too) because of the different prompt we get
-# when using annotation level 2.
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
#
-if [is_remote target] then {
+if ![target_can_use_run_cmd] {
return 0
}
return -1
}
-# are we on a target board? If so, don't run these tests.
-# note: this is necessary because we cannot use runto_main (which would
-# work for remote targets too) because of the different prompt we get
-# when using annotation level 2.
+# This testcase cannot use runto_main because of the different prompt
+# we get when using annotation level 2.
#
-if [is_remote target] then {
+if ![target_can_use_run_cmd] {
return 0
}
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if { [is_remote target] || ![isnative] } then {
+if ![target_can_use_run_cmd] {
continue
}
}
}
+# Returns true iff the target supports using the "run" command.
+
+proc target_can_use_run_cmd {} {
+ if [target_info exists use_gdb_stub] {
+ # In this case, when we connect, the inferior is already
+ # running.
+ return 0
+ }
+
+ # Assume yes.
+ return 1
+}
+
# Generic run command.
#
# The second pattern below matches up to the first newline *only*.