-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-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
standard_testfile
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
}
# The following tests require execution.
if ![runto_main] then {
- fail "Can't run to main"
+ fail "can't run to main"
return 0
}
" = True" \
"test Frame.read_register(pc)"
-# On x86-64, PC is in $rip register.
-if {[istarget x86_64-*]} {
- gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.read_register('rip')))" \
+# Test arch-specific register name.
+set pc ""
+if {[is_amd64_regs_target]} {
+ set pc "rip"
+} elseif {[is_x86_like_target]} {
+ set pc "eip"
+}
+if { $pc != "" } {
+ gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.read_register('$pc')))" \
" = True" \
- "test Frame.read_register(rip)"
+ "test Frame.read_register($pc)"
}