[testsuite] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)

Message ID 20150111145114.GA11550@host2.jankratochvil.net
State New, archived
Headers

Commit Message

Jan Kratochvil Jan. 11, 2015, 2:51 p.m. UTC
  On Sun, 11 Jan 2015 14:58:06 +0100, Yao Qi wrote:
> With your patch applied, this test is skipped on 'x86_64 -m32'.  I
> prefer to increasing the test coverage, so how about extending the test
> for 'x86_64 -m32'?  I mean test Frame.read_register(eip)...

OK this way?


Thanks,
Jan
gdb/testsuite/
2015-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.python/py-frame.exp (test Frame.read_register(rip)): Use
	is_amd64_regs_target and is_x86_like_target.
  

Comments

Yao Qi Jan. 12, 2015, 1:38 a.m. UTC | #1
Jan Kratochvil <jan.kratochvil@redhat.com> writes:

> OK this way?

Yes, it is OK to me.
  
Jan Kratochvil Jan. 12, 2015, 10:05 a.m. UTC | #2
On Mon, 12 Jan 2015 02:38:29 +0100, Yao Qi wrote:
> Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> > OK this way?
> 
> Yes, it is OK to me.

Checked in:
	7e67715dd369f0a0caadaa5e528918dd65176e3b


Jan
  

Patch

diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index bf2e1ce..33fdbe5 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -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)"
 }