This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFA] Fix some incorrect native/remote checks in the testsuite


Daniel Jacobowitz wrote:
> 
> A large number of tests condition on [isnative] when they really want
> ![is_remote target], as best I can tell.  This fixes a few of the (vast
> number of) timeouts running a localhost gdbserver testsuite.  Most of the
> others appear to be in MI, with a large number of other failures.
> 
> Tested on i386-linux against my not-yet-reviewed (hint) gdbserver patches.
> OK to commit?
> 

I guess isnative does not take into consideration running a remote
target with the same architecture as the host (which would not 
happen when these things were written).  Actually, the isnative
seems to be checking for build == target!  Maybe that makes sense,
I would have to check it more carefully but I don't have the time
now.

Lets try your patch. Please check it in.

Thanks again.

Fernando

> --
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
> 
> 2002-02-09  Daniel Jacobowitz  <drow@mvista.com>
> 
>         * gdb.base/a2-run.exp: Check for a remote target properly.
>         * gdb.base/annota1.exp: Likewise.
>         * gdb.base/list.exp: Likewise.
>         * gdb.base/reread.exp: Likewise.
>         * gdb.base/scope.exp: Likewise.
>         * gdb.base/shlib-call.exp: Likewise.
>         * gdb.base/term.exp: Likewise.
>         * gdb.c++/annota2.exp: Likewise.
> 
> Index: gdb.base/a2-run.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 a2-run.exp
> --- gdb.base/a2-run.exp 2001/03/06 08:21:50     1.3
> +++ gdb.base/a2-run.exp 2002/02/10 02:48:13
> @@ -232,7 +232,7 @@ if [istarget "*-*-vxworks*"] then {
> 
>  # GOAL: Test that shell is being used with "run".  For remote debugging
>  # targets, there is no guarantee that a "shell" (whatever that is) is used.
> -if [isnative] then {
> +if ![is_remote target] then {
>      send_gdb "run `echo 8`\n"
>      gdb_expect {
>         -re "Starting program.*40320.*$gdb_prompt $" {
> Index: gdb.base/annota1.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota1.exp,v
> retrieving revision 1.8
> diff -u -p -r1.8 annota1.exp
> --- gdb.base/annota1.exp        2002/01/31 05:08:40     1.8
> +++ gdb.base/annota1.exp        2002/02/10 02:48:13
> @@ -30,7 +30,7 @@ if $tracelevel then {
>  # work for remote targets too) because of the different prompt we get
>  # when using annotation level 2.
>  #
> -if ![isnative] then {
> +if [is_remote target] then {
>      return 0
>  }
> 
> Index: gdb.base/list.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/list.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 list.exp
> --- gdb.base/list.exp   2002/01/06 14:42:39     1.3
> +++ gdb.base/list.exp   2002/02/10 02:48:13
> @@ -95,7 +95,7 @@ proc test_listsize {} {
>      # Show the default lines
>      # The second case is for optimized code, it is still correct.
> 
> -    if ![isnative] {
> +    if [is_remote target] {
>         runto_main;
>         unsupported "list default lines around main";
>      } else {
> Index: gdb.base/reread.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/reread.exp,v
> retrieving revision 1.5
> diff -u -p -r1.5 reread.exp
> --- gdb.base/reread.exp 2002/01/21 21:57:52     1.5
> +++ gdb.base/reread.exp 2002/02/10 02:48:13
> @@ -100,7 +100,7 @@ gdb_test "shell touch ${binfile}" "" ""
> 
>  set prms_id 0
> 
> -if ![isnative] {
> +if [is_remote target] {
>      unsupported "run to foo() second time ";
>  } else {
>      gdb_run_cmd
> @@ -124,7 +124,7 @@ if ![isnative] {
>  ### Second pass: verify that GDB checks the executable file's
>  ### timestamp when the program is *restarted*, not just when it exits.
> 
> -if ![isnative] {
> +if [is_remote target] {
>      unsupported "second pass: GDB should check for changes before running"
>  } else {
> 
> Index: gdb.base/scope.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/scope.exp,v
> retrieving revision 1.4
> diff -u -p -r1.4 scope.exp
> --- gdb.base/scope.exp  2002/01/06 14:42:39     1.4
> +++ gdb.base/scope.exp  2002/02/10 02:48:13
> @@ -559,7 +559,7 @@ gdb_test "print 'scope0.c'::filelocal_ro
>  # is responsible for clearing bss and that hasnt' happened yet.
>  #
>  # This is a problem for all non-native targets. -- manson
> -if ![isnative] {
> +if [is_remote target] {
>      unsupported "print 'scope0.c'::filelocal_bss before run"
>  } else {
>      gdb_test "print 'scope0.c'::filelocal_bss" "= 0" \
> Index: gdb.base/shlib-call.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shlib-call.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 shlib-call.exp
> --- gdb.base/shlib-call.exp     2001/03/06 08:21:51     1.3
> +++ gdb.base/shlib-call.exp     2002/02/10 02:48:13
> @@ -268,14 +268,16 @@ gdb_test "break shr1" "Breakpoint 1.*" "
> 
>  # FIXME: should not send "run" explicitly.  Non-portable.
> 
> -gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
> +if ![is_remote target] {
> +  gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
>         "run to bp in shared library"
> 
> -gdb_test "cont" ".*Program exited normally..*"
> +  gdb_test "cont" ".*Program exited normally..*"
> 
> -gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
> +  gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
>         "re-run to bp in shared library (PR's 16495, 18213)"
> 
> -gdb_test "cont" ".*Program exited normally..*"
> +  gdb_test "cont" ".*Program exited normally..*"
> +}
> 
>  return 0
> Index: gdb.base/term.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/term.exp,v
> retrieving revision 1.2
> diff -u -p -r1.2 term.exp
> --- gdb.base/term.exp   2001/03/06 08:21:51     1.2
> +++ gdb.base/term.exp   2002/02/10 02:48:13
> @@ -24,8 +24,8 @@ if $tracelevel then {
>      strace $tracelevel
>  }
> 
> -# This only works for native, I think.
> -if ![isnative] then {
> +# Don't try this for remote targets.
> +if [is_remote target] then {
>      continue
>  }
> 
> Index: gdb.c++/annota2.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/annota2.exp,v
> retrieving revision 1.4
> diff -u -p -r1.4 annota2.exp
> --- gdb.c++/annota2.exp 2002/01/07 19:20:10     1.4
> +++ gdb.c++/annota2.exp 2002/02/10 02:48:13
> @@ -46,7 +46,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/
>  # work for remote targets too) because of the different prompt we get
>  # when using annotation level 2.
>  #
> -if ![isnative] then {
> +if [is_remote target] then {
>      return 0
>  }
> 

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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