public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed] gdb/testsuite: set sysroot in gdb.server/stop-reply-no-thread-multi.exp
Date: Sun,  6 Jun 2021 09:54:17 -0400	[thread overview]
Message-ID: <20210606135417.636809-1-simon.marchi@polymtl.ca> (raw)

From: Simon Marchi <simon.marchi@efficios.com>

I get some random timeouts in this test due to big debug info taking a
lot of time to read through gdbserver.  When host and target are on the
same machine, clear the sysroot parameter so that GDB reads the files
from the local file system, as we already do in many tests.

I agree with what Pedro says here:

  https://sourceware.org/pipermail/gdb-patches/2019-March/156568.html

that if this is bad for us, it's also bad for users, so we should be
fixing the slowness instead.  But so far nobody seems to be working on
it, and the testsuite timeouts are getting in the way, so I think this
"set sysroot" is a net positive for now.

Without this patch, the test takes over 2 minutes to run (most of it
"downloading" libc debug info), with it it takes 10 seconds.

gdb/testsuite/ChangeLog:

	* gdb.server/stop-reply-no-thread-multi.exp: Clear sysroot when
	host and target are local.

Change-Id: Ieb6304f0e56b4575af450913de4210c667c6bf7b
---
 gdb/testsuite/ChangeLog                                 | 5 +++++
 gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 0bd3d1cb8ffc..d51b60c09c5d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-06  Simon Marchi  <simon.marchi@efficios.com>
+
+	* gdb.server/stop-reply-no-thread-multi.exp: Clear sysroot when
+	host and target are local.
+
 2021-06-05  Hannes Domani  <ssbssa@yahoo.de>
 
 	* gdb.python/py-symbol.exp: Fix tests for Python 3.
diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
index 50cf10fe3134..b3ded0e5ab56 100644
--- a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
+++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
@@ -48,6 +48,13 @@ proc run_test { target_non_stop disable_feature } {
 
     save_vars { GDBFLAGS } {
 	append GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\""
+
+	# If GDB and GDBserver are both running locally, set the sysroot to avoid
+	# reading files via the remote protocol.
+	if { ![is_remote host] && ![is_remote target] } {
+	    set GDBFLAGS "$GDBFLAGS -ex \"set sysroot\""
+	}
+
 	clean_restart ${binfile}
     }
 
-- 
2.31.1


                 reply	other threads:[~2021-06-06 13:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210606135417.636809-1-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).