[binutils-gdb] [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10

Tom de Vries vries@sourceware.org
Fri Jan 29 04:12:49 GMT 2021


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

commit 620ec3caae78dd969fc4bdad7fad4248f52386d5
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Jan 29 05:12:46 2021 +0100

    [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10
    
    When running test-case gdb.opt/solib-intra-step.exp with target board
    unix/-m32 and gcc-10, I run into:
    ...
    (gdb) step^M
    __x86.get_pc_thunk.bx () at ../sysdeps/i386/crti.S:68^M
    68      ../sysdeps/i386/crti.S: No such file or directory.^M
    (gdb) step^M
    shlib_second (dummy=0) at solib-intra-step-lib.c:23^M
    23        abort (); /* second-hit */^M
    (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit
    ...
    
    The problem is that the test-case expects to step past the retry line,
    which is optional.
    
    Fix this by removing the state tracking logic from the gdb_test_multiples.  It
    makes the test more difficult to understand, and doesn't specifically test for
    faulty gdb behaviour.
    
    Tested on x86_64-linux.
    
    gdb/testsuite/ChangeLog:
    
    2021-01-29  Tom de Vries  <tdevries@suse.de>
    
            * gdb.opt/solib-intra-step.exp: Remove state tracking logic.

Diff:
---
 gdb/testsuite/ChangeLog                    |  4 ++++
 gdb/testsuite/gdb.opt/solib-intra-step.exp | 26 ++------------------------
 2 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 73bbd00ea7c..842f9a5d7b7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-01-29  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.opt/solib-intra-step.exp: Remove state tracking logic.
+
 2021-01-28  Tom de Vries  <tdevries@suse.de>
 
 	* gdb.arch/i386-gnu-cfi.exp: Capture the position of function gate
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp
index ad19895d890..527b58cd441 100644
--- a/gdb/testsuite/gdb.opt/solib-intra-step.exp
+++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp
@@ -48,52 +48,30 @@ if ![runto_main] then {
 }
 
 set test "first-hit"
-set state 0
 gdb_test_multiple "step" $test {
     -re -wrap " first-hit .*" {
-	gdb_assert { $state != -1 } $test
+	pass $gdb_test_name
     }
     -re -wrap " first-retry .*" {
-	if  { $state != 0 } {
-	    set state -1
-	} else {
-	    set state 1
-	}
 	send_gdb "step\n"
 	exp_continue
     }
     -re -wrap "get_pc_thunk.*" {
-	if  { $state != 1 } {
-	    set state -1
-	} else {
-	    set state 2
-	}
 	send_gdb "step\n"
 	exp_continue
     }
 }
 
 set test "second-hit"
-set state 0
 gdb_test_multiple "step" $test {
     -re -wrap " second-hit .*" {
-	gdb_assert { $state != -1 } $test
+	pass $gdb_test_name
     }
     -re -wrap " second-retry .*" {
-	if { $state != 0 } {
-	    set state -1
-	} else {
-	    set state 1
-	}
 	send_gdb "step\n"
 	exp_continue
     }
     -re -wrap "get_pc_thunk.*" {
-	if  { $state != 1 } {
-	    set state -1
-	} else {
-	    set state 2
-	}
 	send_gdb "step\n"
 	exp_continue
     }


More information about the Gdb-cvs mailing list