This is the mail archive of the gdb-cvs@sourceware.org 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]

[binutils-gdb] Fix gdb.base/remote.exp with native-extended-gdbserver board


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=035522c0228be33b2124ada2f178187e7e53aa6c

commit 035522c0228be33b2124ada2f178187e7e53aa6c
Author: Pedro Alves <palves@redhat.com>
Date:   Tue May 22 23:26:46 2018 +0100

    Fix gdb.base/remote.exp with native-extended-gdbserver board
    
    This fixes gdb.base/remote.exp regressions caused by the previous
    commit to the testcase, when tested with
    --target_board=native-extended-gdbserver.  For example:
    
      ...
      show remote memory-write-packet-size
      The memory-write-packet-size is 0 (default). Packets are limited to 16383 bytes.
      (gdb) FAIL: gdb.base/remote.exp: write-packet default
      ...
    
    With that board, GDB connects to GDBserver at gdb_start time, so GDB
    is showing the actual remote/gdbserver packet size limits.
    
    Fix it using the usual "disconnect" pattern.  While at it, there's no
    need to start GDB before compiling the testcase.
    
    gdb/testsuite/ChangeLog:
    2018-05-22  Pedro Alves  <palves@redhat.com>
    
    	* gdb.base/remote.exp: Only gdb_start after compiling the
    	testcase.  Issue "disconnect" before testing "set remote" command
    	defaults.  Issue clean_restart before running to main.

Diff:
---
 gdb/testsuite/ChangeLog           | 6 ++++++
 gdb/testsuite/gdb.base/remote.exp | 9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 25df82b..24955f65 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
 2018-05-22  Pedro Alves  <palves@redhat.com>
 
+	* gdb.base/remote.exp: Only gdb_start after compiling the
+	testcase.  Issue "disconnect" before testing "set remote" command
+	defaults.  Issue clean_restart before running to main.
+
+2018-05-22  Pedro Alves  <palves@redhat.com>
+
 	* gdb.base/remote.exp: Adjust expected output of "show remote
 	memory-write-packet-size".  Add tests for "set remote
 	memory-write-packet-size 0" and "set remote
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index ba34441..edcfac8 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -21,14 +21,17 @@ if {[target_info gdb_protocol] != "remote"
 
 standard_testfile .c
 
-gdb_start
-
 set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
 if {$result != "" } then {
     untested "failed to compile"
     return -1
 }
 
+gdb_start
+
+# Make sure we're disconnected, in case we're testing with an
+# extended-remote board, therefore already connected.
+gdb_test "disconnect" ".*"
 
 #
 # Part ONE: Check the down load commands
@@ -126,6 +129,8 @@ proc gdb_load_timed {executable class writesize} {
     pass $test
 }
 
+clean_restart $binfile
+
 # These download tests won't actually download anything on !is_remote
 # target boards, but we run them anyway because it's simpler, and
 # harmless.


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