Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Doug Evans <xdje42@gmail.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Another board file for remote host
Date: Mon, 15 Sep 2014 07:59:00 -0000	[thread overview]
Message-ID: <8761gp48to.fsf@codesourcery.com> (raw)
In-Reply-To: <m3sijtphui.fsf@sspiff.org> (Doug Evans's message of "Sun, 14 Sep	2014 22:34:29 -0700")

Doug Evans <xdje42@gmail.com> writes:

> With those two issues addressed I'm happy.

They are fixed in the updated patch below.  I'll commit it tomorrow if
no other objections.

> [I'm sure more issues will arise as I'm seeing failures
> I wouldn't have expected.  I didn't spend much time on them
> and at any rate I think we can get this checked in so that
> we can start addressing them collectively.]

That sounds good to me too.

-- 
Yao (齐尧)

From: Yao Qi <yao@codesourcery.com>
Date: Thu, 28 Aug 2014 21:27:40 +0800
Subject: [PATCH] Another board file for remote host

In the recent review to my patch about copying files to remote host,
we find that we need a board file which is more closely mapped real
remote host testing to improve coverage.  With the board file
local-remote-host-native.exp, DejaGNU copies files to
$build/gdb/testsuite/remote-host to emulate the effect of remote host.
Is it OK?

gdb/testsuite:

2014-09-15  Yao Qi  <yao@codesourcery.com>

	* boards/local-remote-host-native.exp: New file.

diff --git a/gdb/testsuite/boards/local-remote-host-native.exp b/gdb/testsuite/boards/local-remote-host-native.exp
new file mode 100644
index 0000000..69d40d9
--- /dev/null
+++ b/gdb/testsuite/boards/local-remote-host-native.exp
@@ -0,0 +1,85 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# against local host, in remote host mode.
+#
+# This board file is used to emulate the real remote host testing, in
+# which file system of host and build are not shared.  This is achieved
+# by copying files from source directory to ${host_dir}.
+#
+# To use this file:
+# bash$ cd ${build_dir}/gdb
+# bash$ make check RUNTESTFLAGS="--host_board=local-remote-host-native --target_board=local-remote-host-native HOST_DIR=/tmp/foo/"
+#
+# We set both target board and host board together to test a native gdb
+# (host == target) on a remote host (host != build).  $HOST_DIR is the
+# directory for copying files to, to avoid messing up your HOME.  When
+# it is absent, files are copied to ./remote-host.
+
+if { $board_type == "target" } {
+    set_board_info compiler gcc
+}
+
+# We have to explicitly specify GDB with the path to the copy in
+# the build directory because otherwise it will be set to the
+# result of "transform GDB" since the harness thinks we're using
+# a remote host.  See lib/gdb.exp.
+set GDB [file join [pwd] "../gdb"]
+verbose -log "Overriding setting of GDB to $GDB"
+
+set_board_info hostname 127.0.0.1
+
+set_board_info username $env(USER)
+
+# The ssh key should be correctly set up that you ssh to 127.0.0.1
+# without having to type password.
+set_board_info rsh_prog /usr/bin/ssh
+set_board_info rcp_prog /usr/bin/scp
+set_board_info file_transfer "rsh"
+
+if { ![info exists HOST_DIR] } {
+    set HOST_DIR [file join [pwd] "remote-host"]
+}
+
+if { $board_type == "host" } {
+    set_board_info gdb_opts "-d \"${HOST_DIR}\""
+}
+
+proc ${board}_spawn { board cmd } {
+    global board_info
+
+    set remote [board_info $board hostname]
+    set username [board_info $board username]
+    set RSH [board_info $board rsh_prog]
+
+    spawn $RSH -t -l $username $remote $cmd
+    set board_info($board,fileid) $spawn_id
+    return $spawn_id
+}
+
+proc ${board}_download { board src dest } {
+    global HOST_DIR
+
+    if { ![file exists $HOST_DIR] } {
+	file mkdir $HOST_DIR
+    }
+
+    set destfile [file join $HOST_DIR $dest]
+    verbose -log "${board}_download: file copy -force $src $destfile"
+    file copy -force $src $destfile
+
+    return $destfile
+}


      reply	other threads:[~2014-09-15  7:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 13:35 Yao Qi
2014-08-28 14:27 ` Pedro Alves
2014-08-29  1:38   ` Yao Qi
2014-08-28 21:17 ` Jan Kratochvil
2014-08-29  1:55   ` Yao Qi
2014-08-29 12:30     ` Jan Kratochvil
2014-09-01  8:14       ` Yao Qi
2014-09-01  8:44         ` Jan Kratochvil
2014-08-29  3:28 ` Doug Evans
2014-09-02  2:52 ` Yao Qi
2014-09-02 14:53   ` Doug Evans
2014-09-04 13:22     ` Yao Qi
2014-09-15  4:46       ` Yao Qi
2014-09-15  4:55         ` Doug Evans
2014-09-15  5:35       ` Doug Evans
2014-09-15  7:59         ` Yao Qi [this message]

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=8761gp48to.fsf@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=xdje42@gmail.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