From patchwork Wed Jul 10 10:25:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11038365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93A9C14DB for ; Wed, 10 Jul 2019 10:29:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8623428929 for ; Wed, 10 Jul 2019 10:29:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 772C32893C; Wed, 10 Jul 2019 10:29:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1962628929 for ; Wed, 10 Jul 2019 10:29:46 +0000 (UTC) Received: from localhost ([::1]:59784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9r7-0005QU-D0 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Jul 2019 06:29:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41731) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9nk-0001J0-Oq for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl9nj-0000mC-KV for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:16 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hl9nj-0000Ns-9V for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:15 -0400 Received: by mail-wr1-x429.google.com with SMTP id y4so1872725wrm.2 for ; Wed, 10 Jul 2019 03:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZMvoxsO3ETl4fqBEf7cACx/37SrGiYDPW48cWDQTBJA=; b=gb3bRGeFYyrALzSvDTUqmg07n90tD6vdem80Fxl8lWu46a8rosiiStkPIrZ44WlkwD G9xlTEoJEJoitBJ1oIkj/DUw9HVrZGOyymgwy82HOvFJiQevdJylcoJ686JTN9bESZ9N nJ05okDudDlTV1X0fAMXyxB45g0zPkblSr4sXvPRuJUhfAlw0+d1IpBrvy6YV6kGPwmM 1Qkg2fA6Qa1GMy7IzeOiSDPfEsGh0wxfeS9pyCBUFHBaTpeGJdGtJIpni+ypYZ/MyAzz ZvJ34gDNgBsFWgTsHsJEfzb54jgAfpA7I1/1n9INHmgikp1izb6HhHP1CKndt7KP6O0O Sb/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZMvoxsO3ETl4fqBEf7cACx/37SrGiYDPW48cWDQTBJA=; b=n07jloUNT9giUK0z27kwUGgGkSOBfRvez6qyLieRfx+jnqN/4rwYUmgaqW5k2TZ32V Umbw68PrEU2qym0it9QhgKgV+F9L8azRfHJf0T6GP4vgRz7lKHoTjWwIXxAzZZ142pXP h6tfdmV+VANcgGi9u6KojEMb86nlhfC05tP8FwWW47h8+JwxvNT0GlOSL7Ipt2zZyijx FaZ0DW/qQG/paurkYiCpG9e1qhvjLtmKGwRLQtTpOInGspfIU3iqybahKmHQVhuen8PA duHu5NwLmKzoAct8dYmC0AnOOILs64GEoRdZD7QrCjvEQk7GAJuZ66DG7b1wzobnW7A8 kQaQ== X-Gm-Message-State: APjAAAUbAe5Dz83QVnrunD9+INISSDWUXPy3yQN6DLPkLmnyw4/iPca0 2SCfwtpcSR2kw3EObI1Jcqsi9g== X-Google-Smtp-Source: APXvYqy0JLxDWiaWMOcN0LqXGkYUXfCqPbXvlnwSE/VentMqXlCsleamLRnKiYOdk3wK6zcywtMfGA== X-Received: by 2002:a5d:63c8:: with SMTP id c8mr11560301wrw.21.1562754359420; Wed, 10 Jul 2019 03:25:59 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w7sm1547939wmc.46.2019.07.10.03.25.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 03:25:58 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CC0D81FF8C; Wed, 10 Jul 2019 11:25:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 10 Jul 2019 11:25:54 +0100 Message-Id: <20190710102557.3107-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710102557.3107-1-alex.bennee@linaro.org> References: <20190710102557.3107-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 Subject: [Qemu-devel] [PULL 1/4] tests/tcg: fix up test-i386-fprem.ref generation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Richard Henderson , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We never shipped the reference data in the source tree because it's quite big (64M). As a result the only option is to generate it locally. Although we have a rule to generate the reference file we missed the dependency and location changes, probably because it's only run for SLOW test runs. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index b4033ba3d1..d0eb7023e5 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -35,9 +35,9 @@ test-i386-fprem.ref: test-i386-fprem $(call quiet-command, ./$< > $@,"GENREF","generating $@") run-test-i386-fprem: TIMEOUT=60 -run-test-i386-fprem: test-i386-fprem +run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref $(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)") - $(call diff-out,test-i386-fprem, $(I386_SRC)/$<.ref) + $(call diff-out,test-i386-fprem, test-i386-fprem.ref) else run-test-i386-fprem: test-i386-fprem $(call skip-test, $<, "SLOW") From patchwork Wed Jul 10 10:25:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11038361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B32B214E5 for ; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7BA428929 for ; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 991B32892E; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 48B0B2893C for ; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) Received: from localhost ([::1]:59764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9pL-0002pl-Lm for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Jul 2019 06:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41729) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9nk-0001In-Kx for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl9nj-0000lt-C8 for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:16 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40271) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hl9nj-0000P2-4Y for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:15 -0400 Received: by mail-wr1-x432.google.com with SMTP id r1so1842841wrl.7 for ; Wed, 10 Jul 2019 03:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p1ccHw8zWsSvS6fMryBQBe81FnVDKc6P4UtR9wq8jPM=; b=JYAy0hbX7Gnj2kFTy/qWsUo/iKuQLAV1Rc6YOGNv0jwb5XIpucdWhNCsjw5jXflHJo SDYRtREOjSmgqkaDhqSD8nGKFAk77EltLnAGci2StIP7odRaw+ZqjcFJKxZWpldd3SMy Ws2OfezhtrzkbTquQ3CgE9zt6MYRIipO9SCvVOHrHNQiPKzF+LrTBx9DS/NjG7aFdyMo qGABK5pwA5aUxddynZdI0Mll5llxrI7Ze5gNbKJB5D6+PiJ9uvuv6hS1sntew4uXirsN ZmADe0X9VklTumzX0hBl65N5pkKt047szsFk982Y9M13ZI7HyVtJ2LzAtF/U/qLwnwAY ZEIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p1ccHw8zWsSvS6fMryBQBe81FnVDKc6P4UtR9wq8jPM=; b=AXBmiIk2X3iNqltuYB7+s2Va6BCu3qiSRehHUChR+h7rRpoXJmm/3KComB12ybuD+U OKggDNLdBWMIWh63wL8F32JMrv+yYi3PLCw3F6EorrQMTTB+pcDZKsLHUfaE0A5cp17s TtvLRfi+GeWjvRitTnwSnftqC3O0MtayHW7HwDZNittOlmoLdi0J/gPLJlyQuyor0Lx6 5D6pUVvREDStwL6kUuGiwyBl9YgU1Lp2O5S+X1eCuVIIb/PwGitLiMxotpOHfq0B3pKT rsRmxBpQNinqKTfukHk6D5fYJ51HlChp9jUUKNI4Fs2fks+DE5BVj5mYYZ4JE/RflOpe PduQ== X-Gm-Message-State: APjAAAWE5d0WnhTfdAQ9fLlwsY8/g6cmSaYVhw7R4dnd09D46O87zbAt WCt5FCy2rtFaLlMAeEBJxmQGnQ== X-Google-Smtp-Source: APXvYqyzCj/AXrtRCKUk7xeHKvWIwFZ1lRVhEgWRFyJMw73G71riBgz3Vi4PkCkm5VU4RWC+pPM2xQ== X-Received: by 2002:adf:b64b:: with SMTP id i11mr11520724wre.205.1562754360160; Wed, 10 Jul 2019 03:26:00 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z1sm1945444wrv.90.2019.07.10.03.25.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 03:25:59 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E00381FF8F; Wed, 10 Jul 2019 11:25:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 10 Jul 2019 11:25:55 +0100 Message-Id: <20190710102557.3107-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710102557.3107-1-alex.bennee@linaro.org> References: <20190710102557.3107-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PULL 2/4] tests/tcg: fix diff-out pass to properly report failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP A side effect of piping the output to head is squash the exit status of the diff command. Fix this by only doing the pipe if the diff failed and then ensuring the status is non-zero. Signed-off-by: Alex Bennée diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 6fa63cc8d5..9f56768624 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -45,7 +45,11 @@ run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3) endif # $1 = test name, $2 = reference -diff-out = $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","$1.out with $2") +# to work around the pipe squashing the status we only pipe the result if +# we know it failed and then force failure at the end. +diff-out = $(call quiet-command, diff -q $1.out $2 || \ + (diff -u $1.out $2 | head -n 10 && false), \ + "DIFF","$1.out with $2") # $1 = test name, $2 = reason skip-test = @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2 From patchwork Wed Jul 10 10:25:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11038359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74DB96C5 for ; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67C732892E for ; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A41B28929; Wed, 10 Jul 2019 10:27:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F23AC28929 for ; Wed, 10 Jul 2019 10:27:55 +0000 (UTC) Received: from localhost ([::1]:59766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9pL-0002pm-Ba for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Jul 2019 06:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41713) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9nk-0001IC-8a for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl9ni-0000l5-W2 for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:16 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:56072) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hl9ng-0000Qj-TZ for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:13 -0400 Received: by mail-wm1-x330.google.com with SMTP id a15so1706197wmj.5 for ; Wed, 10 Jul 2019 03:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2uf2HRIdbf2h0OGgfW33mzQxfpKIty5w+0euDRtaBug=; b=zROoEq6WNpkvChYeWl+NNuJ2VBffr7+CahyQPCmFDkdtJREmpD/A+3B3mEkO9odoHe ZcAkI/SGNTnnQABde4vhWpqiSIe3lGCAThDWT5rln6mIPckMN2JDRT84zgxoGP2/f9Im DFhxbf19RezX0WernUVbsVgW06BsvnLqcnTY2bm0IDj2EgZagMK0VE6ZatRt9TJxO78A LTaSAk1iZ5dj4RJGPDO1dPEu6anKwTJTuYySG+rXJo4wvWiLZ5JjycsidQiSnzLbRoMG yo6XYrPuKDdyrAsakJIUCNl21T6Wkxses/+BuUxSnnuDe1MF31ImeLxz1/TCZSr8uY8F jhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2uf2HRIdbf2h0OGgfW33mzQxfpKIty5w+0euDRtaBug=; b=l9NqL38r5Gu1JOJrlszLBFWf/BuK2mzTFuNH/nWch37Ye5w2X9BkNJ9ldFylDjLS/2 FfS3I43aWQ7VDVKCh6KKKkiqd3LivYXS4tNWqZFmS8bdcZ//2Y2xJ8uzHgsIM2OIjSwI 1zD64S2z21fY6lgItcy/mmMpNdk/emdfeW/YaB5R7u9N0+gctJyXmTPXzaFniaXB/mke W0QgPfmK82ubzp6EWr5ibV4IlFNcoQpdKoE23Ude4nEC8gDj6YEUlgg64dW2rHIaX7JX whbS6rLHBzAvLtXOiaAylfTfxUBuhyZtY8f9Qcj/oD118+TpkICJ4xAvZEloy8GUo98O 2Ljg== X-Gm-Message-State: APjAAAWwYuBKfaHJntSJWJDzav41humVDK3TRtsfcUWabfW2zaSKUOE6 poXaEQnLHobBT8BIxAjg9uDieQ== X-Google-Smtp-Source: APXvYqyc+GVOb6SLcwgX4mEiq1A0GRTl4gWMyr0g8rqosolWD/vrJYStOYAZ/Ox9k7AQcWWGG/IAlQ== X-Received: by 2002:a1c:4d01:: with SMTP id o1mr4863178wmh.55.1562754360745; Wed, 10 Jul 2019 03:26:00 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t6sm1538550wmb.29.2019.07.10.03.25.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 03:25:59 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 018041FF90; Wed, 10 Jul 2019 11:25:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 10 Jul 2019 11:25:56 +0100 Message-Id: <20190710102557.3107-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710102557.3107-1-alex.bennee@linaro.org> References: <20190710102557.3107-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 Subject: [Qemu-devel] [PULL 3/4] gdbstub: add some notes to the header comment X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a link to the remote protocol spec and an SPDX tag. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/gdbstub.c b/gdbstub.c index 687c02e598..8363683852 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1,6 +1,10 @@ /* * gdb server stub * + * This implements a subset of the remote protocol as described in: + * + * https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html + * * Copyright (c) 2003-2005 Fabrice Bellard * * This library is free software; you can redistribute it and/or @@ -15,6 +19,8 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . + * + * SPDX-License-Identifier: LGPL-2.0+ */ #include "qemu/osdep.h" From patchwork Wed Jul 10 10:25:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 11038367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F6386C5 for ; Wed, 10 Jul 2019 10:29:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3E8328929 for ; Wed, 10 Jul 2019 10:29:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7D472893C; Wed, 10 Jul 2019 10:29:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8922128929 for ; Wed, 10 Jul 2019 10:29:47 +0000 (UTC) Received: from localhost ([::1]:59786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9r8-0005SX-Ta for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Jul 2019 06:29:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41735) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl9nk-0001J4-Qg for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl9nj-0000m4-IM for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:16 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:45392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hl9nj-0000QF-8A for qemu-devel@nongnu.org; Wed, 10 Jul 2019 06:26:15 -0400 Received: by mail-wr1-x444.google.com with SMTP id f9so1821865wre.12 for ; Wed, 10 Jul 2019 03:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2xglArbFUfwd3/IFA91rmfZG+5etlym8PqDYDWRMM+M=; b=lIXILrVIrja/6LD0fWFP/pJct/hfmtiq9zHnk1fZ9I9H67NADezkqr7abp8xDvnH13 sIUTYWR9V//i7zttXEu3japECj7zzInkcg4IQS5AaWFYrPUP2RW9bZxtHz/CPBx31Egk ZddJmzQcBuwRaCcezDw8ygHQ7rRCQ99VTgAh7eJ35maFiGwFWCetxl4HYZ6+Oc/6Cgoi RpgA+oS2W7m/7SSkO/9Ze1Bwffk9SNyBHiPQwIVngXa53LhTpwZEab7dE971lEARn/ZH e6DJu1AMooy2x8RcwrV4exL/qhxf68wwlKYFEgLRUYQ3tg27RfFDrpqLyVPE9I2SFudR QuhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2xglArbFUfwd3/IFA91rmfZG+5etlym8PqDYDWRMM+M=; b=rMAS7Z6RDkUKqWj8hh8OJTqX4akqhN+hsnpKsqtcJQZagFtULYeCOcecUfhMkQGiBL ekoMj1EGXda0d0UUKKwGUDJXjrAiiWJmZdQXJYtL9v2yCYtGd6b3KTo7T9jkBxtyQWEU hc7NmniSMplSgZXl6161iY+Dfs8+j5VIi4dUGY0UwVP1GwWGuHKWA4RdFyfIIMwEQgct SuwwCOV97tpzzgRjUHtx9JHFltH375MMyMJuxTE/7F/KkRddOhtJN9p8TOJzaKtuvnAp fBLwgPeZxBQmVGSHcTgu75DFrnRmvdOHas2/uWgVq8qXnr/GurPnybLsgB+jSx9FYM9a 9HUw== X-Gm-Message-State: APjAAAVytSTTxcdq2GgiPUihRxIbYOV+JZvPu4d7sp2mcjnAHxx2ua9y sHxyBAJ35Hz1+PI/V281hN3GQw== X-Google-Smtp-Source: APXvYqwuW8n3QeE0k2P0biyKm2koBbYc5zxK7caNiHMBpWvfN5i+CSOu57vyEEykMT8pk4MC3Ln3Nw== X-Received: by 2002:a5d:4b0a:: with SMTP id v10mr30565732wrq.308.1562754361296; Wed, 10 Jul 2019 03:26:01 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s25sm1575252wmc.21.2019.07.10.03.25.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 03:25:59 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1676A1FF91; Wed, 10 Jul 2019 11:25:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 10 Jul 2019 11:25:57 +0100 Message-Id: <20190710102557.3107-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710102557.3107-1-alex.bennee@linaro.org> References: <20190710102557.3107-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PULL 4/4] gdbstub: revert to previous set_reg behaviour X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jon Doron , Richard Henderson , Mark Cave-Ayland , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The refactoring of handle_set_reg missed the fact we previously had responded with an empty packet when we were not using XML based protocols. This broke the fallback behaviour for architectures that don't have registers defined in QEMU's gdb-xml directory. Revert to the previous behaviour and clean up the commentary for what is going on. Fixes: 62b3320bddd Signed-off-by: Alex Bennée Tested-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Cc: Jon Doron diff --git a/gdbstub.c b/gdbstub.c index 8363683852..b470aec8ea 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1673,12 +1673,23 @@ static void handle_remove_bp(GdbCmdContext *gdb_ctx, void *user_ctx) put_packet(gdb_ctx->s, "E22"); } +/* + * handle_set/get_reg + * + * Older gdb are really dumb, and don't use 'G/g' if 'P/p' is available. + * This works, but can be very slow. Anything new enough to understand + * XML also knows how to use this properly. However to use this we + * need to define a local XML file as well as be talking to a + * reasonably modern gdb. Responding with an empty packet will cause + * the remote gdb to fallback to older methods. + */ + static void handle_set_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; if (!gdb_has_xml) { - put_packet(gdb_ctx->s, "E00"); + put_packet(gdb_ctx->s, ""); return; } @@ -1698,11 +1709,6 @@ static void handle_get_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; - /* - * Older gdb are really dumb, and don't use 'g' if 'p' is avaialable. - * This works, but can be very slow. Anything new enough to - * understand XML also knows how to use this properly. - */ if (!gdb_has_xml) { put_packet(gdb_ctx->s, ""); return;