Fix more cases of improper test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-frame.exp
index e47f3407e1947c984aa30bc1bdc2f685f69fdd2e..ba799fa39bdf3dbe073a971b420efee9403a5959 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -20,7 +20,7 @@ load_lib gdb-python.exp
 
 standard_testfile
 
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
@@ -30,7 +30,7 @@ if { [skip_python_tests] } { continue }
 # The following tests require execution.
 
 if ![runto_main] then {
-    fail "Can't run to main"
+    fail "can't run to main"
     return 0
 }
 
@@ -105,9 +105,15 @@ gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.pc()))" \
   " = 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)"
 }
This page took 0.026549 seconds and 4 git commands to generate.