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

Simon Marchi simon.marchi@polymtl.ca
Thu Jan 28 15:03:02 GMT 2021



On 2021-01-26 1:03 p.m., Tom de Vries wrote:
> Hi,
> 
> 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 make the retry line step optional, both for shlib_first and
> shlib_second.
> 
> Any comments?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10
> 
> gdb/testsuite/ChangeLog:
> 
> 2021-01-26  Tom de Vries  <tdevries@suse.de>
> 
> 	* gdb.opt/solib-intra-step.exp: Make step into retry line optional.
> 
> ---
>  gdb/testsuite/gdb.opt/solib-intra-step.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp
> index ad19895d890..13e0cf04c7a 100644
> --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp
> +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp
> @@ -63,7 +63,7 @@ gdb_test_multiple "step" $test {
>  	exp_continue
>      }
>      -re -wrap "get_pc_thunk.*" {
> -	if  { $state != 1 } {
> +	if  { $state != 0 && $state != 1 } {
>  	    set state -1
>  	} else {
>  	    set state 2
> @@ -89,7 +89,7 @@ gdb_test_multiple "step" $test {
>  	exp_continue
>      }
>      -re -wrap "get_pc_thunk.*" {
> -	if  { $state != 1 } {
> +	if  { $state != 0 && $state != 1 } {
>  	    set state -1
>  	} else {
>  	    set state 2
> 

I don't really understand what happens here, what state value means what.

A bit of commenting would help.

Simon


More information about the Gdb-patches mailing list