From patchwork Thu Jul 14 15:15:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 13799 Received: (qmail 13676 invoked by alias); 14 Jul 2016 15:16:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13667 invoked by uid 89); 14 Jul 2016 15:16:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_LOTSOFHASH, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=transfers, XML, 2352, powerpc**linux* X-HELO: mail-pa0-f67.google.com Received: from mail-pa0-f67.google.com (HELO mail-pa0-f67.google.com) (209.85.220.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 14 Jul 2016 15:15:51 +0000 Received: by mail-pa0-f67.google.com with SMTP id hh10so4734942pac.1 for ; Thu, 14 Jul 2016 08:15:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=XspeoGAYIp8unBgk5TpTmNDsp5VqEu44H27JT6HrHAA=; b=ZVgG0M7uJ0t0m1yfvaCBgSfcn3oDfqpXN7yypzCOW6s5FfjtxFbN++bGn+01IwQgE5 zJhKl8KrKF+YoKquQ4lOFd4WBleJDAN9aM0OLNU9W36fGq64ct4RZjq8W/HNManco6Ac A6m0t9hI43kMDQk8vGc/HR7aimi27vQ11XfIXrX/5/BYUAe+Otlr2kmwkigSvoHtgyH+ aHNnQ+7+/EetABXyAgElEQKSMTnM9OLKleUAPZEZXKhyc0xthZflEyZ9adSvsM4U7c9o XIhLhFJkjj3LD364AdV7IU9jEpifbT7OEZMZKUYIuGfh9/CCHd+ddTQpPIbHFFufH4kK QM8Q== X-Gm-Message-State: ALyK8tJ++qAxBIDYqKsSe2K35l6awdpr5c0MAu65745SHx/Vg8qtftv5VZIdBVvkIjZcZw== X-Received: by 10.66.242.201 with SMTP id ws9mr23517584pac.7.1468509349723; Thu, 14 Jul 2016 08:15:49 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id an13sm5585272pac.42.2016.07.14.08.15.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 08:15:49 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Skip gdb.server/ tests if lack of XML support Date: Thu, 14 Jul 2016 16:15:45 +0100 Message-Id: <1468509345-3612-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes 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 gdb.server tests if XML is not support and the target has multiple target descriptions. gdb/testsuite: 2016-07-14 Yao Qi * lib/gdbserver-support.exp (skip_gdbserver_tests): Return 1 if gdb_skip_xml_test is true on some targets. --- gdb/testsuite/lib/gdbserver-support.exp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 }