[PATCH] Share gdbservre setting for board files native-*gdbserver.exp

Yao Qi yao@codesourcery.com
Sun Jul 7 08:56:00 GMT 2013


On 07/05/2013 06:25 PM, Pedro Alves wrote:
> This is OK.  It's OK too if you'd like to share remote_upload (and it
> works, of course).
> 

OK, I move ${board}_upload to the gdbserver-base.exp too, and run
testssuite again.  No results changes.

>> >2013-07-05  Yao Qi<yao@codesourcery.com>
> ...
>> >	* boards/gdbserver.exp: New file.
> How about we call this gdbserver-base.exp?  Otherwise I can already picture
> people seeing that file and trying out "--target_board=gdbserver" ...
> 

OK.

>> >+# This file is shared for other  dejagnu "board files" which are used
>> >+# to run the testsuite with gdbserver.
> s/shared for/shared with/ ?  or:
> s/This file is shared for other/This file has common bits shared between other/
> 
> Spurious double space before dejagnu.  s/which/that/ (restrictive clause).
> 
> Suggest:
> 
> # This file has common bits shared between other dejagnu "board files"
> # that are used to run the testsuite with gdbserver.

Fix the comments as you suggested.  Patch below is what I committed.

-- 
Yao (齐尧)

gdb/testsuite:

2013-07-07  Yao Qi  <yao@codesourcery.com>

	* boards/native-gdbserver.exp: Move invoke of
	process_multilib_options to gdbserver-base.exp.
	Move set_board_info 'compiler', 'gdb,noinferiorio',
	'gdb,nofileio', 'gdb_server_prog' and 'gdb,predefined_tsv' to
	gdbserver-base.exp.
	Move proc ${board}_download, ${board}_upload and
	${board}_file to gdbserver-base.exp.
	* boards/native-extended-gdbserver.exp: Likewise.
	* boards/native-stdio-gdbserver.exp: Likewise.
	* boards/gdbserver-base.exp: New file.
---
 gdb/testsuite/boards/gdbserver-base.exp            |   50 ++++++++++++++++++++
 gdb/testsuite/boards/native-extended-gdbserver.exp |   30 +-----------
 gdb/testsuite/boards/native-gdbserver.exp          |   32 +------------
 gdb/testsuite/boards/native-stdio-gdbserver.exp    |   32 +------------
 4 files changed, 53 insertions(+), 91 deletions(-)
 create mode 100644 gdb/testsuite/boards/gdbserver-base.exp

diff --git a/gdb/testsuite/boards/gdbserver-base.exp b/gdb/testsuite/boards/gdbserver-base.exp
new file mode 100644
index 0000000..839af0a
--- /dev/null
+++ b/gdb/testsuite/boards/gdbserver-base.exp
@@ -0,0 +1,50 @@
+# Copyright 2011-2013 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 has common bits shared between other dejagnu "board files"
+# that are used to run the testsuite with gdbserver.
+
+process_multilib_options ""
+
+# The default compiler for this target.
+set_board_info compiler "[find_gcc]"
+
+# Test the copy of gdbserver in the build directory.
+set_board_info gdb_server_prog "../gdbserver/gdbserver"
+
+# Can't do input (or output) in the current gdbserver.
+set_board_info gdb,noinferiorio 1
+
+# gdbserver does not intercept target file operations and perform them
+# on the host.
+set_board_info gdb,nofileio 1
+
+# The predefined TSVs in GDBserver.
+set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
+
+proc ${board}_file { dest op args } {
+    if { $op == "delete" } {
+	return 0
+    }
+    return [eval [list standard_file $dest $op] $args]
+}
+
+proc ${board}_download { board host dest } {
+    return $host
+}
+
+proc ${board}_upload {dest srcfile args} {
+    return $srcfile
+}
diff --git a/gdb/testsuite/boards/native-extended-gdbserver.exp b/gdb/testsuite/boards/native-extended-gdbserver.exp
index d4bc06a..6a0e35f 100644
--- a/gdb/testsuite/boards/native-extended-gdbserver.exp
+++ b/gdb/testsuite/boards/native-extended-gdbserver.exp
@@ -21,6 +21,7 @@
 # bash$ make check RUNTESTFLAGS="--target_board=native-extended-gdbserver"
 
 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.
@@ -28,26 +29,11 @@ global board
 global board_info
 set board_info($board,isremote) 0
 
-process_multilib_options ""
-
-# The default compiler for this target.
-set_board_info compiler "[find_gcc]"
-
-# Can't do input (or output) in the current gdbserver.
-set_board_info gdb,noinferiorio 1
-
-# gdbserver does not intercept target file operations and perform them
-# on the host.
-set_board_info gdb,nofileio 1
-
 set_board_info sockethost "localhost:"
 
 # We will be using the extended GDB remote protocol.
 set_board_info gdb_protocol "extended-remote"
 
-# Test the copy of gdbserver in the build directory.
-set_board_info gdb_server_prog "../gdbserver/gdbserver"
-
 send_user "configuring for gdbserver local testing (extended-remote)\n"
 
 # We must load this explicitly here, and rename the procedures we want
@@ -132,17 +118,3 @@ proc mi_gdb_load { arg } {
 
     return 0
 }
-
-proc ${board}_download { board host dest } {
-    return $host
-}
-
-proc ${board}_file { dest op args } {
-    if { $op == "delete" } {
-	return 0
-    }
-    return [eval [list standard_file $dest $op] $args]
-}
-
-# The predefined TSVs in GDBserver.
-set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
diff --git a/gdb/testsuite/boards/native-gdbserver.exp b/gdb/testsuite/boards/native-gdbserver.exp
index e32f346..6c1430f 100644
--- a/gdb/testsuite/boards/native-gdbserver.exp
+++ b/gdb/testsuite/boards/native-gdbserver.exp
@@ -21,10 +21,7 @@
 # bash$ make check RUNTESTFLAGS="--target_board=native-gdbserver"
 
 load_generic_config "gdbserver"
-process_multilib_options ""
-
-# The default compiler for this target.
-set_board_info compiler "[find_gcc]"
+load_board_description "gdbserver-base"
 
 # This gdbserver can only run a process once per session.
 set_board_info gdb,do_reload_on_run 1
@@ -32,20 +29,11 @@ set_board_info gdb,do_reload_on_run 1
 # There's no support for argument-passing (yet).
 set_board_info noargs 1
 
-# Can't do input (or output) in the current gdbserver.
-set_board_info gdb,noinferiorio 1
-
-# gdbserver does not intercept target file operations and perform them
-# on the host.
-set_board_info gdb,nofileio 1
-
 set_board_info sockethost "localhost:"
 set_board_info use_gdb_stub 1
 
 # We will be using the standard GDB remote protocol.
 set_board_info gdb_protocol "remote"
-# Test the copy of gdbserver in the build directory.
-set_board_info gdb_server_prog "../gdbserver/gdbserver"
 
 proc ${board}_spawn { board cmd } {
     global board_info
@@ -70,21 +58,3 @@ proc ${board}_exec { hostname program args } {
 
     return $result
 }
-
-proc ${board}_download { board host dest } {
-    return $host
-}
-
-proc ${board}_upload {dest srcfile args} {
-    return $srcfile
-}
-
-proc ${board}_file { dest op args } {
-    if { $op == "delete" } {
-	return 0
-    }
-    return [eval [list standard_file $dest $op] $args]
-}
-
-# The predefined TSVs in GDBserver.
-set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
diff --git a/gdb/testsuite/boards/native-stdio-gdbserver.exp b/gdb/testsuite/boards/native-stdio-gdbserver.exp
index 765ed1b..65183ba 100644
--- a/gdb/testsuite/boards/native-stdio-gdbserver.exp
+++ b/gdb/testsuite/boards/native-stdio-gdbserver.exp
@@ -21,10 +21,7 @@
 # bash$ make check RUNTESTFLAGS="--target_board=native-stdio-gdbserver"
 
 load_generic_config "gdbserver"
-process_multilib_options ""
-
-# The default compiler for this target.
-set_board_info compiler "[find_gcc]"
+load_board_description "gdbserver-base"
 
 # This gdbserver can only run a process once per session.
 set_board_info gdb,do_reload_on_run 1
@@ -32,13 +29,6 @@ set_board_info gdb,do_reload_on_run 1
 # There's no support for argument-passing (yet).
 set_board_info noargs 1
 
-# Can't do input (or output) in the current gdbserver.
-set_board_info gdb,noinferiorio 1
-
-# gdbserver does not intercept target file operations and perform them
-# on the host.
-set_board_info gdb,nofileio 1
-
 # Hack into sockethost to pass our peculiar remote connection string.
 set_board_info sockethost "stdio"
 set_board_info gdb,socketport ""
@@ -47,8 +37,6 @@ set_board_info use_gdb_stub 1
 
 # We will be using the standard GDB remote protocol.
 set_board_info gdb_protocol "remote"
-# Test the copy of gdbserver in the build directory.
-set_board_info gdb_server_prog "../gdbserver/gdbserver"
 
 # The argument to pass to "target remote".
 # We build this once we know how the testsuite will start gdbserver.
@@ -132,21 +120,3 @@ proc ${board}_exec { hostname program args } {
 
     return $result
 }
-
-proc ${board}_download { board host dest } {
-    return $host
-}
-
-proc ${board}_upload {dest srcfile args} {
-    return $srcfile
-}
-
-proc ${board}_file { dest op args } {
-    if { $op == "delete" } {
-	return 0
-    }
-    return [eval [list standard_file $dest $op] $args]
-}
-
-# The predefined TSVs in GDBserver.
-set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
-- 
1.7.7.6



More information about the Gdb-patches mailing list