Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: [pushed] Fix gdb.base/remote.exp with native-extended-gdbserver board (Re: [PATCH 08/10] Handle "show remote memory-write-packet-size" when not connected)
Date: Tue, 22 May 2018 23:26:00 -0000	[thread overview]
Message-ID: <ec719b50-da53-f5d8-d4f0-248f165b2638@redhat.com> (raw)
In-Reply-To: <871se31i4e.fsf@redhat.com>

On 05/22/2018 10:43 PM, Sergio Durigan Junior wrote:
> On Monday, May 21 2018, Pedro Alves wrote:
> 

> I'm seeing a few failures on Debian-s390x-native-extended-gdbserver-m64:

>   ...
>   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
>   ...
> 

Ah, I forgot testing with extended-remote.  I've pushed in the fix below.

Thanks!

From 035522c0228be33b2124ada2f178187e7e53aa6c Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Tue, 22 May 2018 23:26:46 +0100
Subject: [PATCH] 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.
---
 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 25df82b4e7..24955f6530 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index ba34441af2..edcfac824f 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.
-- 
2.14.3


  reply	other threads:[~2018-05-22 22:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 14:18 [PATCH 00/10] remote: More multi-target preparation Pedro Alves
2018-05-16 14:18 ` [PATCH 01/10] remote: struct remote_state, use op new Pedro Alves
2018-05-18 20:57   ` Simon Marchi
2018-05-21 15:36     ` [PATCH 1.2 01/10] remote: struct remote_state, use op new, fix leaks Pedro Alves
2018-05-16 14:18 ` [PATCH 02/10] remote: Eliminate remote_hostio_close_cleanup Pedro Alves
2018-05-16 17:43   ` Tom Tromey
2018-05-16 18:53     ` Pedro Alves
2018-05-16 19:46       ` Tom Tromey
2018-05-18 21:04   ` Simon Marchi
2018-05-16 14:18 ` [PATCH 10/10] remote: one struct remote_state per struct remote_target Pedro Alves
2018-05-22  5:07   ` Simon Marchi
2018-05-22 21:06     ` Pedro Alves
2018-05-24 17:00       ` [PATCH 11/10] remote_target::m_remote_state, pointer -> object (Re: [PATCH 10/10] remote: one struct remote_state per struct remote_target) Pedro Alves
2018-05-25  5:23         ` Simon Marchi
2018-05-16 14:18 ` [PATCH 09/10] remote: Make vcont_builder a class Pedro Alves
2018-05-22  5:07   ` Simon Marchi
2018-05-22 21:33     ` Pedro Alves
2018-05-16 14:25 ` [PATCH 05/10] remote: remote_arch_state pointers -> remote_arch_state objects Pedro Alves
2018-05-18 21:17   ` Simon Marchi
2018-05-18 21:18     ` Simon Marchi
2018-05-21 16:12       ` Pedro Alves
2018-05-16 14:25 ` [PATCH 03/10] remote: Make readahead_cache a C++ class Pedro Alves
2018-05-18 21:06   ` Simon Marchi
2018-05-16 14:27 ` [PATCH 04/10] remote: multiple remote_arch_state instances per arch Pedro Alves
2018-05-18 21:09   ` Simon Marchi
2018-05-16 14:28 ` [PATCH 08/10] Handle "show remote memory-write-packet-size" when not connected Pedro Alves
2018-05-18 21:42   ` Simon Marchi
2018-05-21 20:41     ` Pedro Alves
2018-05-22  3:37       ` Simon Marchi
2018-05-22 21:55       ` Sergio Durigan Junior
2018-05-22 23:26         ` Pedro Alves [this message]
2018-05-16 15:46 ` [PATCH 07/10] remote: Move discard_pending_stop_replies call Pedro Alves
2018-05-18 21:29   ` Simon Marchi
2018-05-16 15:50 ` [PATCH 06/10] remote: Small cleanup in compare_section_command Pedro Alves
2018-05-18 21:26   ` Simon Marchi

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=ec719b50-da53-f5d8-d4f0-248f165b2638@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@ericsson.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