This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e67715dd369f0a0caadaa5e528918dd65176e3b

commit 7e67715dd369f0a0caadaa5e528918dd65176e3b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Jan 12 11:02:46 2015 +0100

    [testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)
    
    for x86_64 -m32 run one gets:
    
    +FAIL: gdb.python/py-frame.exp: test Frame.read_register(rip)
    
    I do not have x32 OS here but the %rip test should PASS there I think.
    
    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)...
    
    gdb/testsuite/ChangeLog
    2015-01-12  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.

Diff:
---
 gdb/testsuite/ChangeLog               |  5 +++++
 gdb/testsuite/gdb.python/py-frame.exp | 14 ++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6e967c7..7343d03 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-12  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.
+
 2015-01-11  Doug Evans  <xdje42@gmail.com>
 
 	* lib/dwarf.exp (Dwarf): Flag an error if a numeric attribute value
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)"
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]