Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdb/testsuite/config/gdbserver.exp
@ 2001-04-12 21:18 Elena Zannoni
  2001-05-10 10:33 ` Fernando Nasser
  0 siblings, 1 reply; 3+ messages in thread
From: Elena Zannoni @ 2001-04-12 21:18 UTC (permalink / raw)
  To: gdb-patches

This patch allows a 'make check' using libremote to be a little more
flexible, depending on the baseboard configuration file which can
specify additional parameters.

Thanks
Elena

2001-04-12  Elena Zannoni  <ezannoni@redhat.com>

        * config/gdbserver.exp (gdb_load): Handle the case
        in which the arguments to gdbserver are given in the
        baseboard configuration file.
        Also handle the case in which the server needs to do a
        load.

Index: config/gdbserver.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/config/gdbserver.exp,v
retrieving revision 1.9
diff -u -p -r1.9 gdbserver.exp
--- gdbserver.exp	2001/03/26 19:55:18	1.9
+++ gdbserver.exp	2001/04/13 04:00:55
@@ -92,6 +92,7 @@ set portnum "2345";
 proc gdb_load { args } {
     global server_exec;
     global portnum;
+    global verbose;
 
     # Port id -- either specified in baseboard file, or managed here.
     if [target_info exists gdb,socketport] {
@@ -154,10 +155,20 @@ proc gdb_load { args } {
     set server_exec $args;
 
     # Fire off the debug agent
-    remote_spawn host \
+    if [target_info exists gdb_server_args] {
+        # This flavour of gdbserver takes as arguments those specified 
+        # in the board configuration file
+        set custom_args [target_info gdb_server_args];
+        remote_spawn host \
+    	        "$gdbserver $custom_args >& /dev/null < /dev/null &" \
+	        writeonly 
+    } else {
+        # This flavour of gdbserver takes as arguments the port information
+        # and the name of the executable file to be debugged.
+        remote_spawn host \
 	    "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
 	    writeonly 
-    
+    }   
     # Give it a little time to establish
     sleep 2
 
@@ -169,6 +180,32 @@ proc gdb_load { args } {
     # attach to the "serial port"
     gdb_target_cmd $protocol $gdbport;
 
+    # do the real load if needed
+    if [target_info exists gdb_server_do_load] {
+        send_gdb "load\n"
+        set timeout 2400
+        verbose "Timeout is now $timeout seconds" 2
+        gdb_expect {
+            -re ".*$gdb_prompt $" {
+                if $verbose>1 then {
+                    send_user "Loaded $arg into $GDB\n"
+                }
+                set timeout 30
+                verbose "Timeout is now $timeout seconds" 2
+                return 1
+            }
+            -re "$gdb_prompt $"     {
+                if $verbose>1 then {
+                    perror "GDB couldn't load."
+                }
+            }
+            timeout {
+                if $verbose>1 then {
+                    perror "Timed out trying to load $arg."
+                }
+            }
+        }
+    }
+    
     return 0;
 }
-


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] gdb/testsuite/config/gdbserver.exp
  2001-04-12 21:18 [RFA] gdb/testsuite/config/gdbserver.exp Elena Zannoni
@ 2001-05-10 10:33 ` Fernando Nasser
  2001-05-10 12:37   ` Elena Zannoni
  0 siblings, 1 reply; 3+ messages in thread
From: Fernando Nasser @ 2001-05-10 10:33 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

Elena Zannoni wrote:
> 
> This patch allows a 'make check' using libremote to be a little more
> flexible, depending on the baseboard configuration file which can
> specify additional parameters.
> 
> Thanks
> Elena
> 

Approved.  Thank you.

Fernando



> 2001-04-12  Elena Zannoni  <ezannoni@redhat.com>
> 
>         * config/gdbserver.exp (gdb_load): Handle the case
>         in which the arguments to gdbserver are given in the
>         baseboard configuration file.
>         Also handle the case in which the server needs to do a
>         load.
> 
> Index: config/gdbserver.exp
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/testsuite/config/gdbserver.exp,v
> retrieving revision 1.9
> diff -u -p -r1.9 gdbserver.exp
> --- gdbserver.exp       2001/03/26 19:55:18     1.9
> +++ gdbserver.exp       2001/04/13 04:00:55
> @@ -92,6 +92,7 @@ set portnum "2345";
>  proc gdb_load { args } {
>      global server_exec;
>      global portnum;
> +    global verbose;
> 
>      # Port id -- either specified in baseboard file, or managed here.
>      if [target_info exists gdb,socketport] {
> @@ -154,10 +155,20 @@ proc gdb_load { args } {
>      set server_exec $args;
> 
>      # Fire off the debug agent
> -    remote_spawn host \
> +    if [target_info exists gdb_server_args] {
> +        # This flavour of gdbserver takes as arguments those specified
> +        # in the board configuration file
> +        set custom_args [target_info gdb_server_args];
> +        remote_spawn host \
> +               "$gdbserver $custom_args >& /dev/null < /dev/null &" \
> +               writeonly
> +    } else {
> +        # This flavour of gdbserver takes as arguments the port information
> +        # and the name of the executable file to be debugged.
> +        remote_spawn host \
>             "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
>             writeonly
> -
> +    }
>      # Give it a little time to establish
>      sleep 2
> 
> @@ -169,6 +180,32 @@ proc gdb_load { args } {
>      # attach to the "serial port"
>      gdb_target_cmd $protocol $gdbport;
> 
> +    # do the real load if needed
> +    if [target_info exists gdb_server_do_load] {
> +        send_gdb "load\n"
> +        set timeout 2400
> +        verbose "Timeout is now $timeout seconds" 2
> +        gdb_expect {
> +            -re ".*$gdb_prompt $" {
> +                if $verbose>1 then {
> +                    send_user "Loaded $arg into $GDB\n"
> +                }
> +                set timeout 30
> +                verbose "Timeout is now $timeout seconds" 2
> +                return 1
> +            }
> +            -re "$gdb_prompt $"     {
> +                if $verbose>1 then {
> +                    perror "GDB couldn't load."
> +                }
> +            }
> +            timeout {
> +                if $verbose>1 then {
> +                    perror "Timed out trying to load $arg."
> +                }
> +            }
> +        }
> +    }
> +
>      return 0;
>  }
> -

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] gdb/testsuite/config/gdbserver.exp
  2001-05-10 10:33 ` Fernando Nasser
@ 2001-05-10 12:37   ` Elena Zannoni
  0 siblings, 0 replies; 3+ messages in thread
From: Elena Zannoni @ 2001-05-10 12:37 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: Elena Zannoni, gdb-patches

Fernando Nasser writes:
 > Elena Zannoni wrote:
 > > 
 > > This patch allows a 'make check' using libremote to be a little more
 > > flexible, depending on the baseboard configuration file which can
 > > specify additional parameters.
 > > 
 > > Thanks
 > > Elena
 > > 
 > 
 > Approved.  Thank you.
 > 
 > Fernando
 > 
 > 

Ok, thanks, it is in.

Elena


 > 
 > > 2001-04-12  Elena Zannoni  <ezannoni@redhat.com>
 > > 
 > >         * config/gdbserver.exp (gdb_load): Handle the case
 > >         in which the arguments to gdbserver are given in the
 > >         baseboard configuration file.
 > >         Also handle the case in which the server needs to do a
 > >         load.
 > > 
 > > Index: config/gdbserver.exp
 > > ===================================================================
 > > RCS file: /cvs/cvsfiles/devo/gdb/testsuite/config/gdbserver.exp,v
 > > retrieving revision 1.9
 > > diff -u -p -r1.9 gdbserver.exp
 > > --- gdbserver.exp       2001/03/26 19:55:18     1.9
 > > +++ gdbserver.exp       2001/04/13 04:00:55
 > > @@ -92,6 +92,7 @@ set portnum "2345";
 > >  proc gdb_load { args } {
 > >      global server_exec;
 > >      global portnum;
 > > +    global verbose;
 > > 
 > >      # Port id -- either specified in baseboard file, or managed here.
 > >      if [target_info exists gdb,socketport] {
 > > @@ -154,10 +155,20 @@ proc gdb_load { args } {
 > >      set server_exec $args;
 > > 
 > >      # Fire off the debug agent
 > > -    remote_spawn host \
 > > +    if [target_info exists gdb_server_args] {
 > > +        # This flavour of gdbserver takes as arguments those specified
 > > +        # in the board configuration file
 > > +        set custom_args [target_info gdb_server_args];
 > > +        remote_spawn host \
 > > +               "$gdbserver $custom_args >& /dev/null < /dev/null &" \
 > > +               writeonly
 > > +    } else {
 > > +        # This flavour of gdbserver takes as arguments the port information
 > > +        # and the name of the executable file to be debugged.
 > > +        remote_spawn host \
 > >             "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
 > >             writeonly
 > > -
 > > +    }
 > >      # Give it a little time to establish
 > >      sleep 2
 > > 
 > > @@ -169,6 +180,32 @@ proc gdb_load { args } {
 > >      # attach to the "serial port"
 > >      gdb_target_cmd $protocol $gdbport;
 > > 
 > > +    # do the real load if needed
 > > +    if [target_info exists gdb_server_do_load] {
 > > +        send_gdb "load\n"
 > > +        set timeout 2400
 > > +        verbose "Timeout is now $timeout seconds" 2
 > > +        gdb_expect {
 > > +            -re ".*$gdb_prompt $" {
 > > +                if $verbose>1 then {
 > > +                    send_user "Loaded $arg into $GDB\n"
 > > +                }
 > > +                set timeout 30
 > > +                verbose "Timeout is now $timeout seconds" 2
 > > +                return 1
 > > +            }
 > > +            -re "$gdb_prompt $"     {
 > > +                if $verbose>1 then {
 > > +                    perror "GDB couldn't load."
 > > +                }
 > > +            }
 > > +            timeout {
 > > +                if $verbose>1 then {
 > > +                    perror "Timed out trying to load $arg."
 > > +                }
 > > +            }
 > > +        }
 > > +    }
 > > +
 > >      return 0;
 > >  }
 > > -
 > 
 > -- 
 > Fernando Nasser
 > Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
 > 2323 Yonge Street, Suite #300
 > Toronto, Ontario   M4P 2C9
 > 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-10 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-12 21:18 [RFA] gdb/testsuite/config/gdbserver.exp Elena Zannoni
2001-05-10 10:33 ` Fernando Nasser
2001-05-10 12:37   ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox