public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Disable vgdb tests if xml not supported
Date: Wed, 29 Sep 2021 15:55:22 +0200	[thread overview]
Message-ID: <20210929135520.GA16103@delia> (raw)

Hi,

I build gdb without xml support using --without-expat, and ran into:
...
(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=22032^M
Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=22032^M
relaying data between gdb and process 22032^M
warning: Can not parse XML target description; XML support was disabled at \
  compile time^M
  ...
(gdb) PASS: gdb.base/valgrind-infcall.exp: continue #1
p gdb_test_infcall ()^M
Remote 'g' packet reply is too long (expected 560 bytes, got 800 bytes): ...^M
(gdb) FAIL: gdb.base/valgrind-infcall.exp: p gdb_test_infcall ()
...

After googling the error message with context valgrind gdbserver, I found
indications that the Remote 'g' packet reply error is due to missing xml
support.

And here ( https://www.valgrind.org/docs/manual/manual-core-adv.html ) I
found:
...
GDB version needed for ARM and PPC32/64.

You must use a GDB version which is able to read XML target description sent
by a gdbserver.  This is the standard setup if GDB was configured and built
with the "expat" library.  If your GDB was not configured with XML support, it
will report an error message when using the "target" command.  Debugging will
not work because GDB will then not be able to fetch the registers from the
Valgrind gdbserver.
...

So I guess I'm running into the same problem for x86_64.

Fix this by skipping all gdb.base/valgrind-*.exp tests if xml support is not
available.  Although only the gdb.base/valgrind-infcall*.exp produce fails,
the Remote 'g' packet reply error occurs in all tests, so it seems prudent to
disable them all.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Disable vgdb tests if xml not supported

---
 gdb/testsuite/gdb.base/valgrind-bt.exp        | 5 +++++
 gdb/testsuite/gdb.base/valgrind-disp-step.exp | 5 +++++
 gdb/testsuite/gdb.base/valgrind-infcall-2.exp | 5 +++++
 gdb/testsuite/gdb.base/valgrind-infcall.exp   | 5 +++++
 4 files changed, 20 insertions(+)

diff --git a/gdb/testsuite/gdb.base/valgrind-bt.exp b/gdb/testsuite/gdb.base/valgrind-bt.exp
index b559e433d72..4b84a45d333 100644
--- a/gdb/testsuite/gdb.base/valgrind-bt.exp
+++ b/gdb/testsuite/gdb.base/valgrind-bt.exp
@@ -13,6 +13,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+if { [gdb_skip_xml_test] } {
+    # Valgrind gdbserver requires gdb with xml support.
+    return 0
+}
+
 load_lib valgrind.exp
 
 if [is_remote target] {
diff --git a/gdb/testsuite/gdb.base/valgrind-disp-step.exp b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
index 3aecf00a291..f9429fbd69a 100644
--- a/gdb/testsuite/gdb.base/valgrind-disp-step.exp
+++ b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
@@ -18,6 +18,11 @@
 # really tests is that GDB falls back to in-line stepping
 # automatically instead of getting stuck or crashing.
 
+if { [gdb_skip_xml_test] } {
+    # Valgrind gdbserver requires gdb with xml support.
+    return 0
+}
+
 load_lib valgrind.exp
 
 if [is_remote target] {
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
index 82b3f4e5c49..30881ca72ea 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
@@ -29,6 +29,11 @@
 # terminate called after throwing an instance of 'gdb_exception_error'
 # Aborted (core dumped)
 
+if { [gdb_skip_xml_test] } {
+    # Valgrind gdbserver requires gdb with xml support.
+    return 0
+}
+
 load_lib valgrind.exp
 
 if [is_remote target] {
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index 658d2bdb3de..0108f92ceaf 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -13,6 +13,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+if { [gdb_skip_xml_test] } {
+    # Valgrind gdbserver requires gdb with xml support.
+    return 0
+}
+
 load_lib valgrind.exp
 
 if [is_remote target] {

             reply	other threads:[~2021-09-29 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 13:55 Tom de Vries [this message]
2021-09-30 17:30 ` Tom Tromey
2021-09-30 21:41   ` Tom de Vries
2021-09-30 21:47     ` Tom de Vries
2021-10-05 18:15     ` Tom Tromey
2021-10-06  7:40       ` [PATCH][gdb/testsuite] Add proc require in lib/gdb.exp Tom de Vries
2021-10-07 11:00         ` [PATCH][gdb/testsuite] Prevent compilation fails with unix/-fPIE/-pie Tom de Vries
2021-10-08 14:37           ` Tom de Vries
2021-10-11 10:28         ` [PATCH][gdb/testsuite] Add proc require in lib/gdb.exp Tom de Vries

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=20210929135520.GA16103@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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).