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] Skip gdb.server/ tests if lack of XML support


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

commit bae62ee2087bb54fd06746c99de9b734cc58a721
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Jul 21 09:22:29 2016 +0100

    Skip gdb.server/ tests if lack of XML support
    
    I recently see some gdb.server/*.exp fails in my native gdb testing,
    in which libexpat isn't available, so GDB isn't able to parse xml file.
    It causes gdb.server/ tests fails because GDB can't get registers
    correctly from GDBserver.
    
    (gdb) PASS: gdb.server/connect-without-multi-process.exp: multiprocess=off: break main
    target remote localhost:2352^M
    Remote debugging using localhost:2352^M
    warning: Can not parse XML target description; XML support was disabled at compile time^M
    Reading /lib/ld-linux-armhf.so.3 from remote target...^M
    warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.^M
    Reading /lib/ld-linux-armhf.so.3 from remote target...^M
    Reading symbols from target:/lib/ld-linux-armhf.so.3...Reading /lib/ld-2.17.so.debug from remote target...^M
    Reading /lib/.debug/ld-2.17.so.debug from remote target...^M
    (no debugging symbols found)...done.^M
    Remote 'g' packet reply is too long: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000efffbe00000000808d0f4d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000^
    0x4d0f8d80 in _start () from target:/lib/ld-linux-armhf.so.3^M
    
    Without XML support in GDB, it can't parse xml sent by GDBserver, and has
    to fall back to the oldest arch.  However, GDBserver doesn't know this
    (IMO, this is a defect in RSP), and still choose the right target
    description to create regcache and 'g' packet.  If the port only has
    one target description or coincidentally two sides choose the same
    target description, there is no such issue.  Otherwise, GDB is broken
    on read registers.
    
    This patch is to skip gdbserver tests if XML is not support and the
    target has multiple target descriptions.
    
    gdb/testsuite:
    
    2016-07-21  Yao Qi  <yao.qi@linaro.org>
    
    	* lib/gdbserver-support.exp (skip_gdbserver_tests): Return 1
    	if gdb_skip_xml_test is true on some targets.

Diff:
---
 gdb/testsuite/ChangeLog                 |  5 +++++
 gdb/testsuite/lib/gdbserver-support.exp | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index bc0d25a..d985c88 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2016-07-21  Yao Qi  <yao.qi@linaro.org>
 
+	* lib/gdbserver-support.exp (skip_gdbserver_tests): Return 1
+	if gdb_skip_xml_test is true on some targets.
+
+2016-07-21  Yao Qi  <yao.qi@linaro.org>
+
 	* gdb.server/solib-list.exp: Unset last_loaded_file.
 
 2016-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index b792b23..c0f17cd 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -141,6 +141,20 @@ proc skip_gdbserver_tests { } {
     return 1
   }
 
+    # If GDB is lack of XML support, and targets, like arm, have
+    # multiple target descriptions, GDB doesn't know which target
+    # description GDBserver uses, and may fail to parse 'g' packet
+    # after connection.
+    if { [gdb_skip_xml_test]
+	 && ([istarget "arm*-*-linux*"]
+	     || [istarget "mips*-*-linux*"]
+	     || [istarget "powerpc*-*-linux*"]
+	     || [istarget "s390*-*-linux*"]
+	     || [istarget "x86_64-*-linux*"]
+	     || [istarget "i\[34567\]86-*-linux*"]) } {
+	return 1
+    }
+
   return 0
 }


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