Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>, Mark Wielaard <mark@klomp.org>,
	       Sergio Durigan Junior <sergiodj@redhat.com>
Subject: [PATCH] Implement ${board}_{exec,spawn} for native-extended-gdbserver
Date: Tue, 03 Feb 2015 23:21:00 -0000	[thread overview]
Message-ID: <1423005658-31405-1-git-send-email-sergiodj@redhat.com> (raw)

Hi,

Mark Wielaard is kindly running two Debian buildslaves in our
buildbot, and he noticed that, when testing things under the
native-extended-gdbserver board, there is a huge slowndown due to
several timeouts that are happening.

If you look at the following log:

  <http://gdb-build.sergiodj.net/builders/Debian-i686-native-extended-gdbserver/builds/48/steps/test%20gdb/logs/stdio>

You will notice that this happens because dejagnu is trying to open a
rsh connection to test native-extended-gdbserver, which of course is
wrong, and we end up not testing things properly.

After some investigation (motivated by an idea from Pedro), I found
that our native-extended-gdbserver board does not set the "isremote"
flag properly.  I fixed that by doing two things:

- Defining the ${board}_spawn procedure inside the board file, and

- Moving the ${board}_exec procedure (present at the native-gdbserver
  and native-stdio-gdbserver boards) to the gdbserver-base file.

After that, I am not seeing this failure anymore.

Is this OK to check in?

gdb/testsuite/ChangeLog:
2015-02-03  Sergio Durigan Junior  <sergiodj@redhat.com>

	* boards/gdbserver-base.exp (${board}_exec): New procedure, moved
	from native-gdbserver.exp and native-stdio-gdbserver.exp.
	* boards/native-extended-gdbserver.exp: Do not set isremote using
	board_info.
	(${board}_spawn): New procedure.
	* boards/native-gdbserver.exp (${board}_exec): Moved to
	gdbserver-base.exp.
	* boards/native-stdio-gdbserver.exp (${board}_exec): Likewise.
---
 gdb/testsuite/boards/gdbserver-base.exp            | 12 ++++++++++++
 gdb/testsuite/boards/native-extended-gdbserver.exp | 18 ++++++++++++------
 gdb/testsuite/boards/native-gdbserver.exp          | 12 ------------
 gdb/testsuite/boards/native-stdio-gdbserver.exp    | 12 ------------
 4 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/gdb/testsuite/boards/gdbserver-base.exp b/gdb/testsuite/boards/gdbserver-base.exp
index c77dc6e..1a52915 100644
--- a/gdb/testsuite/boards/gdbserver-base.exp
+++ b/gdb/testsuite/boards/gdbserver-base.exp
@@ -50,3 +50,15 @@ proc ${board}_download { board host dest } {
 proc ${board}_upload {dest srcfile args} {
     return $srcfile
 }
+
+proc ${board}_exec { hostname program args } {
+    global board_info
+
+    set baseboard [lindex [split $hostname "/"] 0]
+
+    set board_info($baseboard,isremote) 0
+    set result [remote_exec $hostname $program $args]
+    set board_info($baseboard,isremote) 1
+
+    return $result
+}
diff --git a/gdb/testsuite/boards/native-extended-gdbserver.exp b/gdb/testsuite/boards/native-extended-gdbserver.exp
index 57503db..0059c4e 100644
--- a/gdb/testsuite/boards/native-extended-gdbserver.exp
+++ b/gdb/testsuite/boards/native-extended-gdbserver.exp
@@ -23,12 +23,6 @@
 load_generic_config "extended-gdbserver"
 load_board_description "gdbserver-base"
 
-# By default, dejagnu makes the board remote unless the board name
-# matches localhost.  Force it to be NOT remote.
-global board
-global board_info
-set board_info($board,isremote) 0
-
 set_board_info sockethost "localhost:"
 
 # We will be using the extended GDB remote protocol.
@@ -119,3 +113,15 @@ proc mi_gdb_load { arg } {
 
     return 0
 }
+
+proc ${board}_spawn { board cmd } {
+    global board_info
+
+    set baseboard [lindex [split $board "/"] 0]
+
+    set board_info($baseboard,isremote) 0
+    set result [remote_spawn $board $cmd]
+    set board_info($baseboard,isremote) 1
+
+    return $result
+}
diff --git a/gdb/testsuite/boards/native-gdbserver.exp b/gdb/testsuite/boards/native-gdbserver.exp
index 7738b2e..3d972ba 100644
--- a/gdb/testsuite/boards/native-gdbserver.exp
+++ b/gdb/testsuite/boards/native-gdbserver.exp
@@ -47,15 +47,3 @@ proc ${board}_spawn { board cmd } {
 
     return $result
 }
-
-proc ${board}_exec { hostname program args } {
-    global board_info
-
-    set baseboard [lindex [split $hostname "/"] 0]
-
-    set board_info($baseboard,isremote) 0
-    set result [remote_exec $hostname $program $args]
-    set board_info($baseboard,isremote) 1
-
-    return $result
-}
diff --git a/gdb/testsuite/boards/native-stdio-gdbserver.exp b/gdb/testsuite/boards/native-stdio-gdbserver.exp
index 2ec2a47..b8d0949 100644
--- a/gdb/testsuite/boards/native-stdio-gdbserver.exp
+++ b/gdb/testsuite/boards/native-stdio-gdbserver.exp
@@ -75,15 +75,3 @@ proc ${board}_spawn { board cmd } {
 
     return $result
 }
-
-proc ${board}_exec { hostname program args } {
-    global board_info
-
-    set baseboard [lindex [split $hostname "/"] 0]
-
-    set board_info($baseboard,isremote) 0
-    set result [remote_exec $hostname $program $args]
-    set board_info($baseboard,isremote) 1
-
-    return $result
-}
-- 
1.9.3


             reply	other threads:[~2015-02-03 23:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 23:21 Sergio Durigan Junior [this message]
2015-02-04 13:06 ` Pedro Alves
2015-02-04 13:59   ` Pedro Alves
2015-02-06  8:45   ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423005658-31405-1-git-send-email-sergiodj@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark@klomp.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox