This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Expect for another variant of error message when gdbserver cannot resolve hostname
- From: Sergio Durigan Junior <sergiodj at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 13 Jul 2018 20:26:01 -0000
- Subject: [binutils-gdb] Expect for another variant of error message when gdbserver cannot resolve hostname
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7f1f7e23939adc7d71036a17fc6081e3af7ca585
commit 7f1f7e23939adc7d71036a17fc6081e3af7ca585
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Fri Jul 13 16:20:34 2018 -0400
Expect for another variant of error message when gdbserver cannot resolve hostname
I've noticed that on a few hosts, when given an invalid hostname,
gdbserver fails with:
spawn /../../gdb/gdbserver/gdbserver --once tcp8:123:2353 /gdb/build/fedora-s390x/build/gdb/testsuite/outputs/gdb.server/server-connect/server-connect
tcp8:123:2353: cannot resolve name: No address associated with hostname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exiting
Unfortunately, this causes a fail on the new
gdb.server/server-connect.exp test (introduced by the IPv6 patch):
FAIL: gdb.server/server-connect.exp: tcp8: start gdbserver: gdbserver should fail but did not
This happens because we're expecting for another variant of this error
message:
cannot resolve name: Name or service not known
Therefore, this patch extends the helper function 'gdbserver_start' to
also recognize the "No address associated with hostname" message.
This "fixes" the testcase on the hosts that use this variant.
gdb/testsuite/ChangeLog:
2018-07-13 Sergio Durigan Junior <sergiodj@redhat.com>
* lib/gdbserver-support.exp (gdbserver_start): Expect for the
message "No address associated with hostname" when gdbserver
cannot resolve the hostname.
Diff:
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/lib/gdbserver-support.exp | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 570ba53..ec7a819 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-13 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * lib/gdbserver-support.exp (gdbserver_start): Expect for the
+ message "No address associated with hostname" when gdbserver
+ cannot resolve the hostname.
+
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.threads/pthreads.exp: Test qcs FLAG arguments.
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index ed9b31b..a0ba467 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -326,7 +326,7 @@ proc gdbserver_start { options arguments } {
continue
}
}
- -re ".*: cannot resolve name: Name or service not known\r\n" {
+ -re ".*: cannot resolve name: \(No address associated with hostname|Name or service not known\)\r\n" {
error "gdbserver cannot resolve name."
}
timeout {