From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325836; cv=none; d=zohomail.com; s=zohoarc; b=ezA4f8S+FNYXybEAcW5CmnOutxMyCQ0XdjKtjMddGARqBgB6feGxTqiZIg5KSX8o9W8AhwbDpFcPJalXYOn+otBaLHqZQaadD1XXLhJmvTK1ANW2A6uZ+EY/nTYr342uB64SJNlb7hEcf74alaX5ho6Y02GolJOjmq2jWV90kzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325836; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; b=ABh1PGvpgALzq3jkRWc3cQ1RR8nZw9jtmCGUilSquglklYB+YVKJMHZTBHVyMtl2dCp/KtHvyuvx12ccpwv4ZSpikY1rIFcDtkCM6exeOr8S7IajLwT5uOo1LDZNW3oclB8HHigfQaPidZONjzSykp6L9MnQMpnY6fahsv3R+9k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325836610707.9828905325625; Tue, 29 Aug 2023 09:17:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nj-0004xX-Lw; Tue, 29 Aug 2023 12:15:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004mc-Ch for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:39 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NL-0004My-Qk for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40061928e5aso43074655e9.3 for ; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p24-20020a1c7418000000b003fef60005b5sm14230907wmc.9.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5D00D1FFBC; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325729; x=1693930529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; b=OPjuIq+lhacqGmPEEuRb4KKwIJLkWdWDU75MDpFI19c38aMl9YMeWS7aDrZRFNMYPy cOvuiP22HyY//7/UPdBWIkjsFzBg0O7+4uOlsdGiUSZKsFTbRyLJ2gLEp4R9UNpVCGRR fEt241fdzGQ2RSebqevQuiQ+r8mCLNi1xfTnd/uxJ2vPJRLR9AV1MN85jogH/mNfRsOx gSt5UmvFhTq7KOKiuCRJ6X/EXDGnI3uqhhjZA/mwtOmItZPRn2BEwS7vL4rHjWX6Ow3J WKJGO8KM5HYGCKUJUITBB2R/8fWNPw/D/NYMljM+tQEn4GalJLZbJ7uLHy7iV15MWsnw 6WFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325729; x=1693930529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; b=N20aOznsA2ddFe4NOLPUrPZz7B84sbjEeLPHhEVuRjJnR74mR7guxvQMpwY9ix2uxw 7sIRx7DlyhsmZDj2yQlYOwZ+jPiV+oMUjROgfbqPeRtWTTfFgRWSJE0EkfkSPuBFLd8n HRS4qTYefYIHEZD0Iq4GLcQ7BVPcEyETOB+y83Yjjei86cCaqmb+cwoWrAyzyrMyem7z iEiUPhhEwWOTyrRqQNoS90xmonAcAL5CoPLBaiQDdcd4JjpWv9k+ayL6qUqQa8IS30wi kM8l9eHGBhvc/T/Wcdw+6gIST2e7a31KI4tSAuCnACwclzFd6I0jPMdJmdtHAIljJXE5 s4uA== X-Gm-Message-State: AOJu0YxQRkSzgCbbW2JDu5d/I0Bs4+iHKTlcWOQvSJIaH9SG+7WuCP83 oUOkk6oqkpYGWKuZWeMgVu8FwA== X-Google-Smtp-Source: AGHT+IEkUkZX/ga0o3b/yW/6xW089nfvi0JZ/xrxpVq8jlDGn8hGDWV0naaaDGJEvB30xX+1eJyJMA== X-Received: by 2002:a5d:4f8d:0:b0:319:520b:2228 with SMTP id d13-20020a5d4f8d000000b00319520b2228mr21352389wru.27.1693325729234; Tue, 29 Aug 2023 09:15:29 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 01/12] gitlab: enable ccache for many build jobs Date: Tue, 29 Aug 2023 17:15:17 +0100 Message-Id: <20230829161528.2707696-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325838085100001 From: Daniel P. Berrang=C3=A9 The `ccache` tool can be very effective at reducing compilation times when re-running pipelines with only minor changes each time. For example a fresh 'build-system-fedora' job will typically take 20 minutes on the gitlab.com shared runners. With ccache this is reduced to as little as 6 minutes. Normally meson would auto-detect existance of ccache in $PATH and use it automatically, but the way we wrap meson from configure breaks this, as we're passing in an config file with explicitly set compiler paths. Thus we need to add $CCACHE_WRAPPERSPATH to the front of $PATH. For unknown reasons if doing this in msys though, gcc becomes unable to invoke 'cc1' when run from meson. For msys we thus set CC=3D'ccache gcc' before invoking 'configure' instead. A second problem with msys is that cache misses are incredibly expensive, so enabling ccache massively slows down the build when the cache isn't well populated. This is suspected to be a result of the cost of spawning processes under the msys architecture. To deal with this we set CCACHE_DEPEND=3D1 which enables ccache's 'depend_only' strategy. This avoids extra spawning of the pre-processor during cache misses, with the downside that is it less likely ccache will find a cache hit after semantically benign compiler flag changes. This is the lesser of two evils, as otherwise we can't use ccache at all under msys and remain inside the job time limit. If people are finding ccache to hurt their pipelines, it can be disabled by setting the 'CCACHE_DISABLE=3D1' env variable against their gitlab fork CI settings. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230824163910.1737079-2-alex.bennee@linaro.org> Message-Id: <20230804111054.281802-2-berrange@redhat.com> Signed-off-by: Alex Benn=C3=A9e --- docs/devel/ci-jobs.rst.inc | 7 +++++ .gitlab-ci.d/buildtest-template.yml | 11 ++++++++ .gitlab-ci.d/crossbuild-template.yml | 26 +++++++++++++++++++ .gitlab-ci.d/windows.yml | 13 ++++++++-- .../dockerfiles/debian-hexagon-cross.docker | 9 ++++++- 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc index 3f6802d51e..4c39cdb2d9 100644 --- a/docs/devel/ci-jobs.rst.inc +++ b/docs/devel/ci-jobs.rst.inc @@ -188,3 +188,10 @@ If you've got access to a CentOS Stream 8 x86_64 host = that can be used as a gitlab-CI runner, you can set this variable to enable the tests that require this kind of host. The runner should be tagged with both "centos_stream_8" and "x86_64". + +CCACHE_DISABLE +~~~~~~~~~~~~~~ +The jobs are configured to use "ccache" by default since this typically +reduces compilation time, at the cost of increased storage. If the +use of "ccache" is suspected to be hurting the overall job execution +time, setting the "CCACHE_DISABLE=3D1" env variable to disable it. diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-t= emplate.yml index f3e39b7eb1..4fbfeb6667 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -2,11 +2,21 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache + key: "$CI_JOB_NAME" + when: always before_script: - JOBS=3D$(expr $(nproc) + 1) script: + - export CCACHE_BASEDIR=3D"$(pwd)" + - export CCACHE_DIR=3D"$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE=3D"500M" + - export PATH=3D"$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build + - ccache --zero-stats - ../configure --enable-werror --disable-docs --enable-fdt=3Dsystem ${TARGETS:+--target-list=3D"$TARGETS"} $CONFIGURE_ARGS || @@ -20,6 +30,7 @@ then make -j"$JOBS" $MAKE_CHECK_ARGS ; fi + - ccache --show-stats =20 # We jump some hoops in common_test_job_template to avoid # rebuilding all the object files we skip in the artifacts diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild= -template.yml index d97611053b..3e5f4d9cd8 100644 --- a/.gitlab-ci.d/crossbuild-template.yml +++ b/.gitlab-ci.d/crossbuild-template.yml @@ -2,10 +2,20 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache + key: "$CI_JOB_NAME" + when: always timeout: 80m script: + - export CCACHE_BASEDIR=3D"$(pwd)" + - export CCACHE_DIR=3D"$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE=3D"500M" + - export PATH=3D"$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build + - ccache --zero-stats - ../configure --enable-werror --disable-docs --enable-fdt=3Dsystem --disable-user $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS --target-list-exclude=3D"arm-softmmu cris-softmmu @@ -18,6 +28,7 @@ version=3D"$(git describe --match v[0-9]* 2>/dev/null || git rev-par= se --short HEAD)"; mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi + - ccache --show-stats =20 # Job to cross-build specific accelerators. # @@ -29,7 +40,15 @@ stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG timeout: 30m + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" script: + - export CCACHE_BASEDIR=3D"$(pwd)" + - export CCACHE_DIR=3D"$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE=3D"500M" + - export PATH=3D"$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS @@ -40,7 +59,14 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" script: + - export CCACHE_BASEDIR=3D"$(pwd)" + - export CCACHE_DIR=3D"$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE=3D"500M" - mkdir build - cd build - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index cd7622a761..12a987cd71 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -5,13 +5,14 @@ - windows - windows-1809 cache: - key: "${CI_JOB_NAME}-cache" + key: "$CI_JOB_NAME" paths: - msys64/var/cache + - ccache when: always needs: [] stage: build - timeout: 80m + timeout: 100m variables: # This feature doesn't (currently) work with PowerShell, it stops # the echo'ing of commands being run and doesn't show any timing @@ -72,6 +73,7 @@ bison diffutils flex git grep make sed $MINGW_TARGET-capstone + $MINGW_TARGET-ccache $MINGW_TARGET-curl $MINGW_TARGET-cyrus-sasl $MINGW_TARGET-dtc @@ -101,11 +103,18 @@ - Write-Output "Running build at $(Get-Date -Format u)" - $env:CHERE_INVOKING =3D 'yes' # Preserve the current working directory - $env:MSYS =3D 'winsymlinks:native' # Enable native Windows symlink + - $env:CCACHE_BASEDIR =3D "$env:CI_PROJECT_DIR" + - $env:CCACHE_DIR =3D "$env:CCACHE_BASEDIR/ccache" + - $env:CCACHE_MAXSIZE =3D "500M" + - $env:CCACHE_DEPEND =3D 1 # cache misses are too expensive with preproc= essor mode + - $env:CC =3D "ccache gcc" - mkdir build - cd build + - ..\msys64\usr\bin\bash -lc "ccache --zero-stats" - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=3Dsystem $CONFIG= URE_ARGS" - ..\msys64\usr\bin\bash -lc "make" - ..\msys64\usr\bin\bash -lc "make check MTESTARGS=3D'$TEST_ARGS' || { c= at meson-logs/testlog.txt; exit 1; } ;" + - ..\msys64\usr\bin\bash -lc "ccache --show-stats" - Write-Output "Finished build at $(Get-Date -Format u)" =20 msys2-64bit: diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/d= ocker/dockerfiles/debian-hexagon-cross.docker index 153fc7cfb3..7c38d7c9e4 100644 --- a/tests/docker/dockerfiles/debian-hexagon-cross.docker +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker @@ -15,6 +15,7 @@ RUN apt-get update && \ # Install common build utilities apt-get install -y --no-install-recommends \ curl \ + ccache \ xz-utils \ ca-certificates \ bison \ @@ -27,7 +28,12 @@ RUN apt-get update && \ python3-wheel && \ # Install QEMU build deps for use in CI DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ - apt build-dep -yy --arch-only qemu + apt build-dep -yy --arch-only qemu && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc =20 RUN /usr/bin/pip3 install tomli =20 @@ -35,6 +41,7 @@ ENV TOOLCHAIN_INSTALL /opt ENV TOOLCHAIN_RELEASE 16.0.0 ENV TOOLCHAIN_BASENAME "clang+llvm-${TOOLCHAIN_RELEASE}-cross-hexagon-unkn= own-linux-musl" ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolc= hain-for-hexagon/v${TOOLCHAIN_RELEASE}/${TOOLCHAIN_BASENAME}.tar.xz +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" =20 RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL" ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu= /bin --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325921; cv=none; d=zohomail.com; s=zohoarc; b=NCkZvQ048ffzQlsNG6BDfRVXBB3m+SOacfh1Yg87yK3k/nUvYt/EH91LKfLeV/8abpKciekeMvTM2Gl98sw5oJkRYwBqLqLTGgO7MqPDZj6Q3Cds2+pqMDWv21VfSNfn1dUC+MP7txMCLiQLvStgKoQxcYiYXVGA4YRtbKJ4u9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325921; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; b=OqMFyPkcj6l+bCI86gdkAw614SRt6Zfpzb0PefSnwmpyxXp6YxYnyubBkOs8O9w8qHV6ep+qFcGsDQ3V/HGlK4KyoTXOiD2FCAX5QI38BQ9XuU2nPvUGWZEOqUctKjN7Pt7OpUZx7SoMnM3d0Jdd5P5jrTJke0op1Shk1ikw5dI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325921463805.1011031317014; Tue, 29 Aug 2023 09:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Np-000564-1Y; Tue, 29 Aug 2023 12:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nm-000515-6g for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:58 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004N8-Qf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:57 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31dcf18f9e2so1641417f8f.0 for ; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 21-20020a05600c231500b003fc0505be19sm14371693wmo.37.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 747951FFBD; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325729; x=1693930529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; b=RfNV7JpGpTXLU4D803M+5ff/KJsHaquxIMZhbgjNLgjPHbd6h596//0IGv+A1rGzd4 oYtRW9NL8HWN4Lw/ilaE9QcPy7ANgL02jS9RQcgj8YF1VZZLO0VPPbUGUHXGL0gpY+BU Srcj7IO2RjKFYGhyR1keAYGj9QbHkLyEW5X2vxbxA4gg4YuOJiDy+cudYCoHm1PW1VMq wonZ3Qern6C+P0aNKEN3UYH0D94NwrT8AfENT6X9JoRYWvOAqGziDnafpiJL6/sWpt1Q jQI6OJD1fmnCA+ieyf/YbOhtcwfdOh3X1EiW9TKdGAcaE3lOKW9PCphTf0WijISXdp+5 9gRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325729; x=1693930529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; b=aC+ulwex1c/jSCyiimqKg14HaoV1zwd2F102ePhzr8yqed/98jjzcT6SAKlW1hJsiT NUyu9f4AkX2sG+64B17g4bKyx+uQ0mD7t5zA7koTnKn+orI0qynZ5NPS0nBxJF0149B7 UY63zsHJXztdt89S/yPSOYagxjbDL53jSCmxu0iJgdiYpxMbgKYvgRiWyY+R6H7vwnvV t33nYvdRPRhg0v0yajbjRaGx+PMpU4CjuV6wxzNfeVq10r3yIkUqJJVSqrnGBsghJwei lGskQzo9EwgXuuxqsVG4v8mIn2ahB/AdCs2mxP2fDvQ6YUsxdCL8WXsvLKbXUEhPKrFT bcNQ== X-Gm-Message-State: AOJu0YzxO5NxovwnbHyrCmPz906J85nco5Z86A+dRw4FORa1XVPiWItf JhFZtdOqiRsciTFyeDiwJhtyWg== X-Google-Smtp-Source: AGHT+IFuGeZNM+oO+vMhd38UffW+fTdVXkUCoYbZ78BByNwXmXWaqIKV7lePNtI3iiPFg6DvB2GmuQ== X-Received: by 2002:adf:f9c4:0:b0:317:5d1c:9719 with SMTP id w4-20020adff9c4000000b003175d1c9719mr24199159wrr.9.1693325729483; Tue, 29 Aug 2023 09:15:29 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 02/12] tests/docker: cleanup non-verbose output Date: Tue, 29 Aug 2023 17:15:18 +0100 Message-Id: <20230829161528.2707696-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325923082100003 Even with --quiet docker will spam the sha256 to the console. Avoid this by redirecting stdout. While we are at it fix the name we echo which was broken during 0b1a649047 (tests/docker: use direct RUNC call to build containers). Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/docker/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 142e8605ee..dfabafab92 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -46,9 +46,9 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker --build-arg BUILDKIT_INLINE_CACHE=3D1 \ $(if $(NOUSER),, \ --build-arg USER=3D$(USER) \ - --build-arg UID=3D$(UID)) \ - -t qemu/$* - < $<, \ - "BUILD", $1) + --build-arg UID=3D$(UID)) \ + -t qemu/$* - < $< $(if $V,,> /dev/null),\ + "BUILD", $*) =20 # Special rule for debootstraped binfmt linux-user images docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325850; cv=none; d=zohomail.com; s=zohoarc; b=ajiYQPet24JKty0ZF1yMXEWFU3p7cpGYQ/1rrPbHvzUM12yX6a0pUn7Smb2n2hEr9cPLOin0Jduf2F1ZnNduhLPV8Mvnqto9ddvakr5uyL4sQYYvy/sM9U5FpiRq16PrfHIjn4KuB1t/lKdfkZOqSa/chGehe8kokEyLaiMLsQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; b=Cd9B3AgPu2yQmMhBcchRUt/o4pBwoek9DZ4Hu9/nC/7P9JUjnYezp477XjYSOndw8hgMrKsyc+n3PnrJWQd5P6sz8tsQ6ZvR3Qkc5F6EQe3xm7cgNqOS4s/fM2J+LHbLdUocGjx7GAaE4qayI2izviLeTLeMLni9QjMEyxtejW8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325850680494.1193598785544; Tue, 29 Aug 2023 09:17:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nb-0004pI-HG; Tue, 29 Aug 2023 12:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NU-0004nG-Fx for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NM-0004OM-E9 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:39 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40078c4855fso42862305e9.3 for ; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 13-20020a05600c228d00b003fefd46df47sm17577554wmf.29.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F0CE1FFBE; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325731; x=1693930531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; b=DpwcIjKm/Se76BIRTXWEvwjIqhZbcgDN0FFtXqaYm9rkSU6rtYsTMUL7YyZRHtx3// Q5jSjKwbV/GRtd7wGWCB8mR8iH0pPcVIukQGRsUW3+pv0Hv0p0qrHXY8aNQDX7l7MRfi WDx8htSXGg4z5EQo/0wMfVPeiJb5l14PDywO1F2i5N043MlCQBYgnK2Z2oqz9Mb3K5/Q BrvaCu+lKdesyNMNfifaxXfz10UfhySEiXWW6xNh6LkHm+OeFXcECH1duZ4x/pEQYk+w jYERSJkXQUlbxUZ1t4UGbGBXgm00D9qAspAB93mHPLGgw5Uy4rg8Nb73zg7G3bMrGk93 lVWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325731; x=1693930531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; b=MqkRkmwuzfdXgP7sgk8+kdZCoHWt3xH+zKMDkJARtqyO+lInyNwxaOw6LJUyQoXFPz RbFkgRi6B7pa6YTnh13ELDHbfQgcK4Ctl6O8KfUIAIczf6Y8urxPVOMuOimy+t/c8xZv ESjGIohtHerUnCfAp7TaS0a+yRS32eUUfFm076q3/KX7whtM3hDPLK3S92n9bcvEZkTc E+kKGGXMsX1nZ6FirNv1J68epLZgU8MOtkQk51QOOdt+ipbjPyYITawLN+yoWoWb9wq8 0IupG75YksAC8uSCsN9PLGmrTkATNeCz+OP82oas9VVD2t+K9/aVdIazBFOBK9FMwvE5 B58Q== X-Gm-Message-State: AOJu0YylVYfG1IMVZW7Y37lFPxj39rc8WxH9bgIfXhJRJR7kwzRztCyZ ZdMKlFN62pMLRf2mYNBnDmfnJA== X-Google-Smtp-Source: AGHT+IHrIyDmNCtrRpbpasUc+8f99zfhRd97Nv4lyUprL+BeGtXx5R3t+sqXNaF4Lc/rPCiXQp7Ggg== X-Received: by 2002:a1c:f304:0:b0:3fb:e4ce:cc65 with SMTP id q4-20020a1cf304000000b003fbe4cecc65mr21255098wmq.25.1693325730869; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 03/12] tests/tcg: remove quoting for info output Date: Tue, 29 Aug 2023 17:15:19 +0100 Message-Id: <20230829161528.2707696-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325852667100003 This avoids ugly multi-line wrapping for the test on non V=3D1 builds. Signed-off-by: Alex Benn=C3=A9e Acked-by: Richard Henderson --- tests/tcg/aarch64/Makefile.target | 2 +- tests/tcg/multiarch/system/Makefile.softmmu-target | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index 681dfa077c..b77bbd9b3c 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -14,7 +14,7 @@ AARCH64_TESTS=3Dfcvt pcalign-a64 lse2-fault fcvt: LDFLAGS+=3D-lm =20 run-fcvt: fcvt - $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)") + $(call run-test,$<,$(QEMU) $<) $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) =20 config-cc.mak: Makefile diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg= /multiarch/system/Makefile.softmmu-target index 7ba9053375..a051d689d7 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -37,10 +37,10 @@ run-gdbstub-untimely-packet: hello --qemu $(QEMU) \ --bin $< --qargs \ "-monitor none -display none -chardev file$(COMMA)path=3Duntimely-packet= .out$(COMMA)id=3Doutput $(QEMU_OPTS)", \ - "softmmu gdbstub untimely packets") + softmmu gdbstub untimely packets) $(call quiet-command, \ (! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err= ), \ - "GREP", "file untimely-packet.gdb.err") + "GREP", file untimely-packet.gdb.err) else run-gdbstub-%: $(call skip-test, "gdbstub test $*", "no guest arch support") --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=zohomail.com; s=zohoarc; b=nheD+yNjWASzhPbUHFxbOBiYsJt9FKiwQPGQXswBa1hzXKZw1/diireZ33RKsWl5MmBSSYh4VZHohBFuiU6N9foK72zX74sz+e3TX9RQOxywm+P6XWREoOaV7xkBFIHRJt7GTIDhE1WDhqLDPeASMM3yrIoR4/AWVOrf6Na6X0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325818; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; b=DnKU+LVaYXyzP3TNfaPE87jcXhn4bjeg/+c6GyOV0IHaeWazxLHkJ/LpdSGOAUdTchVFuBoBnN5PcXJj6QsKfvsNibGzW4DEZCHBL0XlhKAUBSKor9J++z7zEcH/v8nZC+CU/k5vtHLhECxNhJKD2alYY5D5R2QU7RYz1o8ZLtQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325818762138.0403826261803; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Ni-0004uk-TZ; Tue, 29 Aug 2023 12:15:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NU-0004nH-G9 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NM-0004OH-DD for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fefe898f76so45071975e9.0 for ; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l4-20020adff484000000b003197a4b0f68sm14357588wro.7.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A70E91FFBF; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325730; x=1693930530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; b=AxZnMkqnTdFfPhoc8pKiUmrB9AxxnzwWR+eetooDI0+GxpNyCaM0orLmp+0u2QMzmg 7liHZyijK/5Gwrcie/qY3QrSTCgKGNuIkyvSpEI2BBGH/KEvzl+deEKTig4wxWa5UF6h jD6YMbSm8qx1QlPx09Wp7YQqVUrD0BYvAjaOT1JTeTuEs3HwdYR6g2ramsSJawt0kTYL 7XX7D0pvHBSW5pzVjgnciMe0RxJBiwaObjC8AkeTivWD+tYZlgE2KI5RK155hxbmppzq A/h76wJ0GbrhPDlfR8eiTy3rmHmMhfIQupIgyCAFbjb3jzRznaCRUaOYf8LOwQRGR/qM jLWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325730; x=1693930530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; b=L4uyRdW4wIcHpkF1I/NlVv1qFo5Aj4z17kzazdAl1FT8tllffH4PymmWKQr9i6OL0q xxDnDz3eRDQM/jreX2ZWB/u84TbCe+k3tTRgJX2YvckuPuZYlItfLZM4IEZJRf2AxRCD htcMNYdB1ZJJNrEXoM1ZLg6QQovlJ/mhvq+uwFdlyNX/L7rqFYq5ReLzCJPKGeZRWokJ eYu9SHycd0jdUblrMbmGve7gsy4MKTmZWLkKBskCrR8gCAthh6iABGfykq9aan2t7q2c daGQs4wteuQq/BbZlwgNZSGrNAQGp+IOkbNZ+9V32Y8l2U+RZdYZrSNDl/mS2qO68SYx 9KBg== X-Gm-Message-State: AOJu0YxLRICE26yNjjTQzj2uDwCbxcRmiy/BN5/qABzXbUBpjsl7C7gp SraXGVRSi3dInBRna3K3Yat7rA== X-Google-Smtp-Source: AGHT+IF7UUc6/x2VJ3X2eskj0/McdSfyEB4xEBcpeDnHceEXs0kpCeLAzcslpKxllXd80+x+lFCvtA== X-Received: by 2002:a5d:6282:0:b0:31a:c6ef:5edc with SMTP id k2-20020a5d6282000000b0031ac6ef5edcmr19002628wru.12.1693325730643; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Stefan Hajnoczi Subject: [PATCH v3 04/12] docs/style: permit inline loop variables Date: Tue, 29 Aug 2023 17:15:20 +0100 Message-Id: <20230829161528.2707696-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325820636100011 I've already wasted enough of my time debugging aliased variables in deeply nested loops. While not scattering variable declarations around is a good aim I think we can make an exception for stuff used inside a loop. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230822155004.1158931-1-alex.bennee@linaro.org> --- docs/devel/style.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 3cfcdeb9cd..2f68b50079 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -204,7 +204,14 @@ Declarations =20 Mixed declarations (interleaving statements and declarations within blocks) are generally not allowed; declarations should be at the beginning -of blocks. +of blocks. To avoid accidental re-use it is permissible to declare +loop variables inside for loops: + +.. code-block:: c + + for (int i =3D 0; i < ARRAY_SIZE(thing); i++) { + /* do something loopy */ + } =20 Every now and then, an exception is made for declarations inside a #ifdef or #ifndef block: if the code looks nicer, such declarations can --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325956; cv=none; d=zohomail.com; s=zohoarc; b=epljmvCQ9dxWojPsmhzKC59iRc9RuipuNKsdpeJWQso7gBxKd8VPBJbxTgtsav9nnbDYHBOibNSoTJzGgRyvpCJvVv/iZ+hkG8Djf1Qttv2pMME5m17bpYE1uHRm46uKt8MSv/Xfo8FlpdBR4ukp+7JuijAyPcc/1VatDc+fMaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325956; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; b=BHkrenisBUxER9uyZyh4K5B8awZ1nLfcr2/vQr5saT0mTHw7H5s4F+SwjykQYX6h7JU+wtoXT+9uE3SjICkvathVX2QRNXhtpMgeSEPRZFRsHx30z+Xtlx0iExW2UM4HJRapNz82UlYuF/yi+UsSfwOYCIDSULNVG89cIiafcWg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325956158290.4009612573492; Tue, 29 Aug 2023 09:19:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nn-00052H-0v; Tue, 29 Aug 2023 12:15:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NY-0004p4-D4 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:45 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NP-0004PG-PA for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:43 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401d10e3e54so14428005e9.2 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h14-20020a05600c260e00b003fefb94ccc9sm14326506wma.11.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BEE061FFC0; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; b=cw+YPilqNTOPDy2QcgniekMAJi9dZpoGNYDsCQ/s4m5nosMOFu0Yr0nGrmYz5DlTFl XyYdJlAbwR/XTy7Gnik8u5/qF+zYAk2Kqgs5Z4o2lBOlrsBjJHZmwpK80EEnO4cadUxU VqjIKvq5ZjMDtExlPOl2hchFEUWNy3RY5EcO+kjw9EClGyoR9IaoX1LAEZS2Odm8DVc9 rDy0uIARoGzmBFmOlRTcq6IGe9bmZmX413Eq8/tXWdr8dINtKvjYyoShWe23Oyw1QS6y Z0GDpebYQ2DeA+bbyt91WLU00jwmXorjB+O/tjzj+AKM6n3ryRZGIBcERYs0lNEMiGSL hk8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; b=l34R7GP6PbiL+EISHinld99n1WcPyC9FvKzDTC/HjxMOGZZX958+QElBCdM1FuoBN4 xQlmcZ5CXedoQx5LEVg3XwL44zhfX3nXiAAsAUSxE8xf2zVE8Ynyji0wae1ZS6fsqGJ8 /D/aO2ZpxuwfERlorcND2UYlD5eeMLM7Cqvto/qJSvQ9bfgWBd5Yq9cc9M8hZJsdZOj9 Rdu2FNC5ELZlaI1B2WZ78vWwB8CqsE55tTwMNWggPPRXWeHDbUWOlYn4NNhGdkncjUlX UJ86HC7wH8jP8y/I3eubVDaY2RInbxibOTnokMSQcLoHpzEUm+OyO8VRR2bbiPmlNijc TYlg== X-Gm-Message-State: AOJu0YyAPJAn8w915Ry5tnvUob+fjGzDGz0IE13+0g6a/eiZRnyGooI7 bgAr/4ed/IEiZudqEPycB9pQ/A== X-Google-Smtp-Source: AGHT+IFuuBSw89fV6pTURv3C7CQSoKutwlukpxJYg+1Mm3pLuOszxq6hybiYBKqV3gvhTlqkIBjQfw== X-Received: by 2002:a05:600c:1d1f:b0:401:d803:6241 with SMTP id l31-20020a05600c1d1f00b00401d8036241mr1580739wms.21.1693325731804; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 05/12] .gitlab-ci.d/cirrus.yml: Update FreeBSD to v13.2 Date: Tue, 29 Aug 2023 17:15:21 +0100 Message-Id: <20230829161528.2707696-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325957131100003 From: Thomas Huth The FreeBSD CI job started to fail due to linking problems ... time to update to the latest version to get this fixed. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230823144533.230477-1-thuth@redhat.com> Signed-off-by: Alex Benn=C3=A9e --- .gitlab-ci.d/cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml index 1507c928e5..41d64d6680 100644 --- a/.gitlab-ci.d/cirrus.yml +++ b/.gitlab-ci.d/cirrus.yml @@ -50,7 +50,7 @@ x64-freebsd-13-build: NAME: freebsd-13 CIRRUS_VM_INSTANCE_TYPE: freebsd_instance CIRRUS_VM_IMAGE_SELECTOR: image_family - CIRRUS_VM_IMAGE_NAME: freebsd-13-1 + CIRRUS_VM_IMAGE_NAME: freebsd-13-2 CIRRUS_VM_CPUS: 8 CIRRUS_VM_RAM: 8G UPDATE_COMMAND: pkg update; pkg upgrade -y --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325966; cv=none; d=zohomail.com; s=zohoarc; b=b6u3YDSi6QLGBDNp4fzhcnlyawgKV9QKoXrJSgCwlIJ18Fx9XF95oSZbFXGorzkq4hcJdnsbPXfAmZ1WUbIVIpk6oVsCs6FYXMCyNoj0g7mKHVLqsj0G/1Ufa/H6zxO9rnGDtPp/sJUEvjgprzj7SMglUgfYuPUG7FSXrblQPXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325966; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; b=E5hP/0Cdo7DOah3RbaRHgPJdDdqyZc3WweVKxYKyMcHgtkPcScpTqgWsQiaLm2ds8A7L/yT84dPIAhrm3rOlaXJvuQL+fQABNzGhWJ7S8+qNUevwSfiGPYKurQeisYdONtPVNiv6B5h7tGf5f/RTe5oFjJrG0RVuW4SO7Ivx5xM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325966845810.8241552772258; Tue, 29 Aug 2023 09:19:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nq-00058y-6n; Tue, 29 Aug 2023 12:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Ng-0004uO-9t for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:53 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004Pa-7c for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:52 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4018af103bcso29005845e9.1 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m24-20020a7bca58000000b00401b242e2e6sm15458189wml.47.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D68671FFC1; Tue, 29 Aug 2023 17:15:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; b=tSHJ2RHunsRg7Clom3CMqvc0+KPdhsEyi4+oGGI2r+RCvogE0b8MVB0zUaVblz6aq3 8PouThfWdLySns7ER3elFHDZf7BsZ2dtjCjzynA/zGLrZjf8fRtWuLNY4ZOelhVBcam9 sXG4WoWEc6ZqADMhtYjNgtZ3kl+QjR51OnuEPZbSuX8e+qBIpj7Gch8AhOPgvAN6yBUK 2X/rI25KwoX4bNBfEH4K/f0MZSSykyPuztQ8sjCE1I8uSwPmvzCQHCKh73+hZkpWE++y 3AXyrv4fIHFico+AYW51WSUAU8/lj9NtefbQJzs+AqBCoQH4mivXvc6BoePgG+Qpo8/i jvPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; b=LkP2ZMJ/fSIboRlP2EiLPq9hwvxGZ7gjYLFFx4MUqYFHm5CmLnHLF2I0B/Pdcy1XdJ D4GQiskgwhjQhVlGfpuixzldZDAotB6Ho5N2WVuwfopLqFXyWIplIpAI1GJmPW8IVr+X HDROovyu7OEnLEZYM4pQQHDWci+UtcFDU1vHhw1tYBJyYuLoLakesNZ+0Dfaoev5G04+ QY1MEoQWqskGpk3p60iv43ChlamobiTvCPQ/H5hMKkLHutsH5oFCXEgF7ZDepQjAUnau j7cvuzvXP/iwpKNXwKBwSBUwvGvcj73GsxWGxSoydEj9wSNNnhs21QNR/eP+9y4QEF/2 Z5gw== X-Gm-Message-State: AOJu0YyngDWHPCsNpE2B0eg1XZwUAJWfq+vJ+KXZ2LS5h8DpiOhLvBfE jBxq5DzdcagXDwSd3b6HB3e/zw== X-Google-Smtp-Source: AGHT+IHIIVld0NGumENqoIVw7lJuZM/9oSP/UdxYa20tmtv2DnEvVWPG2c0t7OHbW/mGDvSGl6Utlg== X-Received: by 2002:a1c:6a11:0:b0:3fb:416d:7324 with SMTP id f17-20020a1c6a11000000b003fb416d7324mr2446803wmc.6.1693325732031; Tue, 29 Aug 2023 09:15:32 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 06/12] tests: remove test-gdbstub.py Date: Tue, 29 Aug 2023 17:15:22 +0100 Message-Id: <20230829161528.2707696-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325968945100003 This isn't directly called by our CI and because it doesn't run via our run-test.py script does things slightly differently. Lets remove it as we have plenty of working in-tree tests now for various aspects of gdbstub. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- tests/guest-debug/test-gdbstub.py | 177 ------------------------------ 1 file changed, 177 deletions(-) delete mode 100644 tests/guest-debug/test-gdbstub.py diff --git a/tests/guest-debug/test-gdbstub.py b/tests/guest-debug/test-gdb= stub.py deleted file mode 100644 index 98a5df4d42..0000000000 --- a/tests/guest-debug/test-gdbstub.py +++ /dev/null @@ -1,177 +0,0 @@ -# -# This script needs to be run on startup -# qemu -kernel ${KERNEL} -s -S -# and then: -# gdb ${KERNEL}.vmlinux -x ${QEMU_SRC}/tests/guest-debug/test-gdbstub.py - -import gdb - -failcount =3D 0 - - -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount +=3D 1 - - -def check_step(): - "Step an instruction, check it moved." - start_pc =3D gdb.parse_and_eval('$pc') - gdb.execute("si") - end_pc =3D gdb.parse_and_eval('$pc') - - return not (start_pc =3D=3D end_pc) - - -def check_break(sym_name): - "Setup breakpoint, continue and check we stopped." - sym, ok =3D gdb.lookup_symbol(sym_name) - bp =3D gdb.Breakpoint(sym_name) - - gdb.execute("c") - - # hopefully we came back - end_pc =3D gdb.parse_and_eval('$pc') - print ("%s =3D=3D %s %d" % (end_pc, sym.value(), bp.hit_count)) - bp.delete() - - # can we test we hit bp? - return end_pc =3D=3D sym.value() - - -# We need to do hbreak manually as the python interface doesn't export it -def check_hbreak(sym_name): - "Setup hardware breakpoint, continue and check we stopped." - sym, ok =3D gdb.lookup_symbol(sym_name) - gdb.execute("hbreak %s" % (sym_name)) - gdb.execute("c") - - # hopefully we came back - end_pc =3D gdb.parse_and_eval('$pc') - print ("%s =3D=3D %s" % (end_pc, sym.value())) - - if end_pc =3D=3D sym.value(): - gdb.execute("d 1") - return True - else: - return False - - -class WatchPoint(gdb.Breakpoint): - - def get_wpstr(self, sym_name): - "Setup sym and wp_str for given symbol." - self.sym, ok =3D gdb.lookup_symbol(sym_name) - wp_addr =3D gdb.parse_and_eval(sym_name).address - self.wp_str =3D '*(%(type)s)(&%(address)s)' % dict( - type =3D wp_addr.type, address =3D sym_name) - - return(self.wp_str) - - def __init__(self, sym_name, type): - wp_str =3D self.get_wpstr(sym_name) - super(WatchPoint, self).__init__(wp_str, gdb.BP_WATCHPOINT, type) - - def stop(self): - end_pc =3D gdb.parse_and_eval('$pc') - print ("HIT WP @ %s" % (end_pc)) - return True - - -def do_one_watch(sym, wtype, text): - - wp =3D WatchPoint(sym, wtype) - gdb.execute("c") - report_str =3D "%s for %s (%s)" % (text, sym, wp.sym.value()) - - if wp.hit_count > 0: - report(True, report_str) - wp.delete() - else: - report(False, report_str) - - -def check_watches(sym_name): - "Watch a symbol for any access." - - # Should hit for any read - do_one_watch(sym_name, gdb.WP_ACCESS, "awatch") - - # Again should hit for reads - do_one_watch(sym_name, gdb.WP_READ, "rwatch") - - # Finally when it is written - do_one_watch(sym_name, gdb.WP_WRITE, "watch") - - -class CatchBreakpoint(gdb.Breakpoint): - def __init__(self, sym_name): - super(CatchBreakpoint, self).__init__(sym_name) - self.sym, ok =3D gdb.lookup_symbol(sym_name) - - def stop(self): - end_pc =3D gdb.parse_and_eval('$pc') - print ("CB: %s =3D=3D %s" % (end_pc, self.sym.value())) - if end_pc =3D=3D self.sym.value(): - report(False, "Hit final catchpoint") - - -def run_test(): - "Run through the tests one by one" - - print ("Checking we can step the first few instructions") - step_ok =3D 0 - for i in range(3): - if check_step(): - step_ok +=3D 1 - - report(step_ok =3D=3D 3, "single step in boot code") - - print ("Checking HW breakpoint works") - break_ok =3D check_hbreak("kernel_init") - report(break_ok, "hbreak @ kernel_init") - - # Can't set this up until we are in the kernel proper - # if we make it to run_init_process we've over-run and - # one of the tests failed - print ("Setup catch-all for run_init_process") - cbp =3D CatchBreakpoint("run_init_process") - cpb2 =3D CatchBreakpoint("try_to_run_init_process") - - print ("Checking Normal breakpoint works") - break_ok =3D check_break("wait_for_completion") - report(break_ok, "break @ wait_for_completion") - - print ("Checking watchpoint works") - check_watches("system_state") - -# -# This runs as the script it sourced (via -x) -# - -try: - print ("Connecting to remote") - gdb.execute("target remote localhost:1234") - - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - - # Run the actual tests - run_test() - -except: - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount +=3D 1 - import code - code.InteractiveConsole(locals=3Dglobals()).interact() - raise - -# Finally kill the inferior and exit gdb with a count of failures -gdb.execute("kill") -exit(failcount) --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325877; cv=none; d=zohomail.com; s=zohoarc; b=g1s76eB9g9rWZjHGifQTSOQCDPEuYTPYfdiEsApOVlROELFKqvutYbzHbTpuG5Uuzdk+7KYaVGhBEJGiXR7LprNvoqTzJV7oIZ0RxovIvmjQrtsv1nV92RQ8rgybF2hdc8n6O14LBYzA8qXydmb9/bSUYVQ1m5s7OcKl+1tRGt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325877; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; b=QIJTI3cs+CRonSb7NtttaudKxL0wipD7j2lAcgCaJg0QsUKwrVammCyjecVhOY2wJPgrtC09aII+UC6NFhQPRk4jhkq/O5crRWYkMjpaaCARDZT42bVnlBZygFirFsoEMmFGBv1OipLKIxrAxWvWxEbOv5jd7otb/bm81Ez5IQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169332587772356.68591475843573; Tue, 29 Aug 2023 09:17:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nl-00050O-0H; Tue, 29 Aug 2023 12:15:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NX-0004p2-Rw for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:45 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NP-0004R1-PP for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:43 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-31aeee69de0so3902777f8f.2 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o12-20020adfcf0c000000b0031ad2663ed0sm14191827wrj.66.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 10CB61FFC2; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; b=rFpVuyaDuoi2aLFOSDa7GEJpmojOc4JLRnK57/ALAKYOQ6Z+n9NLzRY8Faeap2+THD zeloGHkkUfyBOvFlVwuIXHwC3+U/7MtF6CN+pGjniIJMZiIZZkKDFLlQMxHxzd4CWywC PU1xDVenumllTqJP3663ZJ3oukOdPkkaTxxJLSLnuSpuyCuKKlmVfUCra9Ak+mVTNTxH PF05R00PGLjUIZa282/hbsUtpWD5+4WD3t6JAzqXga96xHhq0eJkLg/pYm+Ujcg99xBM GrT11FJt0dcFz0FwdDzl8jZbzLWdRrpu1zR8S9GyeveISV7MBPqww5fhsHRTvOog7T2G aNKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; b=SZPFESJkyMYCJPU96ZJtpqsl9bp1ITV8IZZJnGoPVivPxBr3/iInwdDpUzxUOnz6rG 1xmWvhgvxrxMUsq4FMsXM05JjpQU49D3zH4zVT+diDLRMaU+ihxbsYHdgPERQJIkeY8P +owXkADrYscpIlPtxBdwVS3lSt10F92w5TCL9o9QOx9tR+gmFnZeDhcla8uydfvZ/fmw JzDnChN/urh7Hnh/gWAjizvDK/wEtifrVYCozE/xT72njz/yB3mi+Jmi3HlSyi/V4HX1 m1/UR21PO/jd+BSpw1o0sgvF9RVWT52+cQVrs6llctZX/WyFnAjiLem/83cSCy5zGsvB Siuw== X-Gm-Message-State: AOJu0Yy7Ub/85Yh6M3/1kohN2g7fZ+DTA5Uos2PK5tr4O6+CGZNZINoO T241oDBAPD43dJy+vfswHOLLgA== X-Google-Smtp-Source: AGHT+IF1l77MBIAGD8NsZtre5DWyHObWYhpW3AsU479B9cS70gUC4w2CI//K7p00xp7rPFyBUeQYUQ== X-Received: by 2002:a5d:65c5:0:b0:317:70cb:4f58 with SMTP id e5-20020a5d65c5000000b0031770cb4f58mr23092298wrw.63.1693325733547; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 07/12] tests/tcg: clean-up gdb confirm/pagination settings Date: Tue, 29 Aug 2023 17:15:23 +0100 Message-Id: <20230829161528.2707696-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325878781100003 We can do this all in the run-test.py script so remove the extraneous bits from the individual tests which got copied from the original non-CI gdb tests. Signed-off-by: Alex Benn=C3=A9e Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tests/guest-debug/run-test.py | 2 ++ tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 3 --- tests/tcg/aarch64/gdbstub/test-sve.py | 3 --- tests/tcg/multiarch/gdbstub/memory.py | 3 --- tests/tcg/multiarch/gdbstub/sha1.py | 4 ---- tests/tcg/multiarch/gdbstub/test-proc-mappings.py | 4 ---- tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py | 4 ---- tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py | 4 ---- tests/tcg/s390x/gdbstub/test-signals-s390x.py | 4 ---- tests/tcg/s390x/gdbstub/test-svc.py | 4 ---- 10 files changed, 2 insertions(+), 33 deletions(-) diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index a032e01f79..b13b27d4b1 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -83,6 +83,8 @@ def log(output, msg): gdb_cmd +=3D " %s" % (args.gdb_args) # run quietly and ignore .gdbinit gdb_cmd +=3D " -q -n -batch" + # disable pagination + gdb_cmd +=3D " -ex 'set pagination off'" # disable prompts in case of crash gdb_cmd +=3D " -ex 'set confirm off'" # connect to remote diff --git a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py b/tests/tcg/aarch6= 4/gdbstub/test-sve-ioctl.py index b9ef169c1a..ee8d467e59 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +++ b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py @@ -76,9 +76,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except: diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbs= tub/test-sve.py index ef57c7412c..afd8ece98d 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve.py +++ b/tests/tcg/aarch64/gdbstub/test-sve.py @@ -66,9 +66,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except: diff --git a/tests/tcg/multiarch/gdbstub/memory.py b/tests/tcg/multiarch/gd= bstub/memory.py index 67864ad902..dd25e72281 100644 --- a/tests/tcg/multiarch/gdbstub/memory.py +++ b/tests/tcg/multiarch/gdbstub/memory.py @@ -115,9 +115,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/sha1.py b/tests/tcg/multiarch/gdbs= tub/sha1.py index 423b720e6d..416728415f 100644 --- a/tests/tcg/multiarch/gdbstub/sha1.py +++ b/tests/tcg/multiarch/gdbstub/sha1.py @@ -73,10 +73,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/= multiarch/gdbstub/test-proc-mappings.py index 5e3e5a2fb7..04ec61d219 100644 --- a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py +++ b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py @@ -51,10 +51,6 @@ def main(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except gdb.error: diff --git a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py b/tests/tc= g/multiarch/gdbstub/test-qxfer-auxv-read.py index d91e8fdf19..926fa962b7 100644 --- a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py +++ b/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py @@ -42,10 +42,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py b/tests/= tcg/multiarch/gdbstub/test-thread-breakpoint.py index 798d508bc7..e57d2a8db8 100644 --- a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py +++ b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py @@ -45,10 +45,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/s390x/gdbstub/test-signals-s390x.py b/tests/tcg/s390= x/gdbstub/test-signals-s390x.py index 80a284b475..ca2bbc0b03 100644 --- a/tests/tcg/s390x/gdbstub/test-signals-s390x.py +++ b/tests/tcg/s390x/gdbstub/test-signals-s390x.py @@ -61,10 +61,6 @@ def run_test(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/s390x/gdbstub/test-svc.py b/tests/tcg/s390x/gdbstub/= test-svc.py index 18fad3f163..804705fede 100644 --- a/tests/tcg/s390x/gdbstub/test-svc.py +++ b/tests/tcg/s390x/gdbstub/test-svc.py @@ -49,10 +49,6 @@ def main(): exit(0) =20 try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except gdb.error: --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=zohomail.com; s=zohoarc; b=Wk+L13XaOzA6DIOzBJJDxSvznWekPnDFtTIJa2jm0hu+rbRzQ9lx1erlBP6F9HOzMh5H+N8iahmtSyIxSRRIg/8cHgmA4sRrOHN2P8HzS0Tez/Ogr2n55hKJ21itKxwnr2+P7T5B9nFZG+jrK90KXKzPFuOSCQ8qcDl9vhXcru8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325818; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; b=ZKLrLHCdGKjsNrFATt1mNLzRu1Sm1Djx/Ri565yZC5St3v9mxh7SuhjjoeNW6bydqZyQJdxT0cng83tP/DqHIII9YbVLZwletkx/erty31aEegKRwhCfWVJPxKnMkFw8lRgjEK0YolYNgRD4Smzxq/jmcIpUYYs+SZPZ8zokWRs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325818708436.99926167023784; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nr-0005AN-Ct; Tue, 29 Aug 2023 12:16:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nk-00050D-Nf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004Pj-QS for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-400e8ca7e38so40109435e9.3 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o23-20020a5d58d7000000b0031980783d78sm14210412wrf.54.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 30B2E1FFC3; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; b=HC+Uzw4pJ58SrxhsrVx0KmFa/C21po8OGLJYGH4et8xnoSBCqw3Y88JvWxapRKKttF uRyUyWQmjlOPlh0oQyUIT9LJXcp14boa3FmYJYZxoF8mueuR2yIkcGIarmZ7xYCWKnpH bB3CUH8sARI0FmzaEHa0dS5JMOkeQIcKrEwSjk3I5E4DGwMN7RFADALfiCu1UxWzb1MD 0gGFvlpcReZD0KWNQfNrpHxnjgF1WNKPSP6Ia1tOpiI5bYaqBCWFjlMik/n3wQojSWh/ 7nZn2VljQGidgZUtLnDOYc9fRI0JCEd0xO2ZS0EyTbPXLBCc0BLJ2AR9dIWw73qnk9gw Am9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; b=ANsM3vnFZE4VmiLI+1opZy89LYx58RtxUmiV46IvRINoaWbMAixxAqvcwBNKtYiGf+ cTFhaF4kuTnraQqdjka3RPa+GCDDp6TpFOeqJH+L/smikDuvkssxxAufUYLkSk5lUlRV v2jndMAr2V7xx9+DRWs/SEz7xvJ7DpDMB6ycT8dUzGTjP1NZlg8k6eXlXxfA0vu34oUR NLB/Sfcr0AN+fnaTdl2uriGWcm21kALD3YSv/+lNQ1iMuYYcEmrD7wMhiwv68cgBSfoI owQfmgMQXJa1OLP9DMOCQ47/8eA2aMjMRY/ClUVwtXAUwIFyne1kNuUy+14BEl13PmCA NlwA== X-Gm-Message-State: AOJu0YyonNECVsZ/pGnk5EjS3qyyil+dsN2Wp9jvxfiq/Uag4TegGOF9 O4EXd4sm3mc6hfEglumURVZ+Kw== X-Google-Smtp-Source: AGHT+IHiU+qV51GRpCZdJIs/MdrluFrn1SvkrEzgr7WehnMdoJKN9wXvrNQ80TYTm/FNMJ+Mk1z5xg== X-Received: by 2002:a7b:c3cf:0:b0:401:6800:7032 with SMTP id t15-20020a7bc3cf000000b0040168007032mr11574070wmj.18.1693325732269; Tue, 29 Aug 2023 09:15:32 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Matheus Branco Borella Subject: [PATCH v3 08/12] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT Date: Tue, 29 Aug 2023 17:15:24 +0100 Message-Id: <20230829161528.2707696-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325820597100008 From: Matheus Branco Borella This fix is implemented by having the vCont handler set the value of `gdbserver_state.c_cpu` if any threads are to be resumed. The specific CPU picked is arbitrarily from the ones to be resumed, but it should be okay, as all GDB cares about is that it is a resumed thread. Signed-off-by: Matheus Branco Borella Message-Id: <20230804182633.47300-2-dark.ryu.550@gmail.com> [AJB: style and whitespace fixes] Signed-off-by: Alex Benn=C3=A9e Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1725 --- v2 - fix up some whitespace --- gdbstub/gdbstub.c | 29 ++++++ tests/tcg/multiarch/system/interrupt.c | 28 ++++++ tests/tcg/multiarch/gdbstub/interrupt.py | 97 +++++++++++++++++++ .../multiarch/system/Makefile.softmmu-target | 12 ++- 4 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 tests/tcg/multiarch/system/interrupt.c create mode 100644 tests/tcg/multiarch/gdbstub/interrupt.py diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 5f28d5cf57..e7d48fa0d4 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -597,6 +597,15 @@ static int gdb_handle_vcont(const char *p) * or incorrect parameters passed. */ res =3D 0; + + /* + * target_count and last_target keep track of how many CPUs we are goi= ng to + * step or resume, and a pointer to the state structure of one of them, + * respectivelly + */ + int target_count =3D 0; + CPUState *last_target =3D NULL; + while (*p) { if (*p++ !=3D ';') { return -ENOTSUP; @@ -637,6 +646,9 @@ static int gdb_handle_vcont(const char *p) while (cpu) { if (newstates[cpu->cpu_index] =3D=3D 1) { newstates[cpu->cpu_index] =3D cur_action; + + target_count++; + last_target =3D cpu; } =20 cpu =3D gdb_next_attached_cpu(cpu); @@ -654,6 +666,9 @@ static int gdb_handle_vcont(const char *p) while (cpu) { if (newstates[cpu->cpu_index] =3D=3D 1) { newstates[cpu->cpu_index] =3D cur_action; + + target_count++; + last_target =3D cpu; } =20 cpu =3D gdb_next_cpu_in_process(cpu); @@ -671,11 +686,25 @@ static int gdb_handle_vcont(const char *p) /* only use if no previous match occourred */ if (newstates[cpu->cpu_index] =3D=3D 1) { newstates[cpu->cpu_index] =3D cur_action; + + target_count++; + last_target =3D cpu; } break; } } =20 + /* + * if we're about to resume a specific set of CPUs/threads, make it so= that + * in case execution gets interrupted, we can send GDB a stop reply wi= th a + * correct value. it doesn't really matter which CPU we tell GDB the s= ignal + * happened in (VM pauses stop all of them anyway), so long as it is o= ne of + * the ones we resumed/single stepped here. + */ + if (target_count > 0) { + gdbserver_state.c_cpu =3D last_target; + } + gdbserver_state.signal =3D signal; gdb_continue_partial(newstates); return res; diff --git a/tests/tcg/multiarch/system/interrupt.c b/tests/tcg/multiarch/s= ystem/interrupt.c new file mode 100644 index 0000000000..98d4f2eff9 --- /dev/null +++ b/tests/tcg/multiarch/system/interrupt.c @@ -0,0 +1,28 @@ +/* + * External interruption test. This test is structured in such a way that = it + * passes the cases that require it to exit, but we can make it enter an + * infinite loop from GDB. + * + * We don't have the benefit of libc, just builtin C primitives and + * whatever is in minilib. + */ + +#include + +void loop(void) +{ + do { + /* + * Loop forever. Just make sure the condition is always a constant + * expression, so that this loop is not UB, as per the C + * standard. + */ + } while (1); +} + +int main(void) +{ + return 0; +} + + diff --git a/tests/tcg/multiarch/gdbstub/interrupt.py b/tests/tcg/multiarch= /gdbstub/interrupt.py new file mode 100644 index 0000000000..e222ac94c5 --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/interrupt.py @@ -0,0 +1,97 @@ +from __future__ import print_function +# +# Test some of the softmmu debug features with the multiarch memory +# test. It is a port of the original vmlinux focused test case but +# using the "memory" test instead. +# +# This is launched via tests/guest-debug/run-test.py +# + +import gdb +import sys + +failcount =3D 0 + + +def report(cond, msg): + "Report success/fail of test" + if cond: + print("PASS: %s" % (msg)) + else: + print("FAIL: %s" % (msg)) + global failcount + failcount +=3D 1 + + +def check_interrupt(thread): + """ + Check that, if thread is resumed, we go back to the same thread when t= he + program gets interrupted. + """ + + # Switch to the thread we're going to be running the test in. + print("thread ", thread.num) + gdb.execute("thr %d" % thread.num) + + # Enter the loop() function on this thread. + # + # While there are cleaner ways to do this, we want to minimize the num= ber of + # side effects on the gdbstub's internal state, since those may mask b= ugs. + # Ideally, there should be no difference between what we're doing here= and + # the program reaching the loop() function on its own. + # + # For this to be safe, we only need the prologue of loop() to not have + # instructions that may have problems with what we're doing here. We d= on't + # have to worry about anything else, as this function never returns. + gdb.execute("set $pc =3D loop") + + # Continue and then interrupt the task. + gdb.post_event(lambda: gdb.execute("interrupt")) + gdb.execute("c") + + # Check whether the thread we're in after the interruption is the same= we + # ran continue from. + return (thread.num =3D=3D gdb.selected_thread().num) + + +def run_test(): + """ + Test if interrupting the code always lands us on the same thread when + running with scheduler-lock enabled. + """ + + gdb.execute("set scheduler-locking on") + for thread in gdb.selected_inferior().threads(): + report(check_interrupt(thread), + "thread %d resumes correctly on interrupt" % thread.num) + + +# +# This runs as the script it sourced (via -x, via run-test.py) +# +try: + inferior =3D gdb.selected_inferior() + arch =3D inferior.architecture() + print("ATTACHED: %s" % arch.name()) +except (gdb.error, AttributeError): + print("SKIPPING (not connected)", file=3Dsys.stderr) + exit(0) + +if gdb.parse_and_eval('$pc') =3D=3D 0: + print("SKIP: PC not set") + exit(0) +if len(gdb.selected_inferior().threads()) =3D=3D 1: + print("SKIP: set to run on a single thread") + exit(0) + +try: + # Run the actual tests + run_test() +except (gdb.error): + print("GDB Exception: %s" % (sys.exc_info()[0])) + failcount +=3D 1 + pass + +# Finally kill the inferior and exit gdb with a count of failures +gdb.execute("kill") +exit(failcount) diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg= /multiarch/system/Makefile.softmmu-target index a051d689d7..90810a32b2 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -27,7 +27,15 @@ run-gdbstub-memory: memory "-monitor none -display none -chardev file$(COMMA)path=3D$<.out$(COMMA)i= d=3Doutput $(QEMU_OPTS)" \ --bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \ softmmu gdbstub support) - +run-gdbstub-interrupt: interrupt + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(HAVE_GDB_BIN) \ + --qemu $(QEMU) \ + --output $<.gdb.out \ + --qargs \ + "-smp 2 -monitor none -display none -chardev file$(COMMA)path=3D$<.out$(= COMMA)id=3Doutput $(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \ + softmmu gdbstub support) run-gdbstub-untimely-packet: hello $(call run-test, $@, $(GDB_SCRIPT) \ --gdb $(HAVE_GDB_BIN) \ @@ -50,4 +58,4 @@ run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb") endif =20 -MULTIARCH_RUNS +=3D run-gdbstub-memory run-gdbstub-untimely-packet +MULTIARCH_RUNS +=3D run-gdbstub-memory run-gdbstub-interrupt run-gdbstub-u= ntimely-packet --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=zohomail.com; s=zohoarc; b=Cwcgh42aaTfKHy+SzAMG9Z1Na9N3J3+LeuT/xxArxm45T0z67odkWg0/hVkttLQXvHrriQcXPlIRoZQR4HtcQ0Qsl3fI2TStb4ktzNxxR2UlnTliCp1i0vuAeq6Ny7uhZQJUq/6nw6ANzgIpO4JqO3sLHWErbC69rm+BYw4OO0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325818; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; b=VbtILv+Ut/5vAlmYf7/nhDQfhsCAvC408LNTC+Z/rGrFhsPupglutchUFtJUWbWeunkrBKrvh7pjHJzJs8GFpL0qIh91xasnptotgMfJlRLksUeXiabloySwcPr4E0edGVB7EjLSIZiDtKL6WtOpsanbXo5bw2+f0FzyGMlsG9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325818696642.5553914524343; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1No-00054P-52; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Ne-0004s5-IN for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:51 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NR-0004Qd-NW for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:49 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-401bbfc05fcso39404665e9.3 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n23-20020a7bcbd7000000b003fef6881350sm14585160wmi.25.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 49F281FFC4; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; b=UivZ0wvUW5A9ZGRXyvfdZXfxbJmx1WcjRElFaE4x50wffeRqrMI5XjFpJX/I3qdcEv rju4cTq+xMiSeDw0XU2AmqQx+mm96TTlE0UDM2RoZGSj4wu9xjK8uxUgGXi1IlHxYHNs kipjpAOH+5RiJCHofScnQ6INwHCr2rXQJmnR4NFgJLHguXtcRuKNvSimTuxFplEYmCq5 VPmQocpN8Y/+X3dRWapp6f2Ixt7yH1rGrhJrKeE2y/Ane/OfYhJO/uPmwebeILO39ymL jRcpyqpgFUAKJMHflW1KGUfDmDIVY0eRgrcuZWumxlBiMRs4JzL6iWokbgcEO0FYku8Q 2SeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; b=kimRKVH84S11CTY4Qrzb7a5xlkqelKqgREz8fJW1YEljOtzsCeL0ovuqjv+pw030hy +/HrolCsWbqYOoD7VEUJpbbRwy2DvOEPAzKotDKsEycCqG4Sw3IkJi+DW8fo5SULZpO4 /2xV++MZF2Fy2yJjdc74EOxJY0CQu+I9EYYsIGsggJ+HvPYA0OiZmWm79ezd7PxPqn1T T9MiP/O1DB5gtSBTdbRAoIb1+AL9RD2tFMbkiUDUFxuJPJAF4KKC+1zl7e1aaV+H92lt cnLc9A9tdd83zql1zAAJfeYorNbIdSEmHWfdhr9ay1InwiVcA+BHfLlmRUpbGv0K0pbr dFug== X-Gm-Message-State: AOJu0YzmVlG4utnVu25RoaTyBd8T2XXSR13NDMgGXkGokiZDy6QsOvD0 xxwYDVoB9HnFrP2F0tYLwxnG1Q== X-Google-Smtp-Source: AGHT+IFAHiSQF38BaJmcSB5Jd58HMaCL1CfJ5HytFZJLywzoX8jxNkniDbYGvlWE6ZZhRUbGfzyPzg== X-Received: by 2002:a05:600c:2807:b0:3fd:30f7:2be1 with SMTP id m7-20020a05600c280700b003fd30f72be1mr20129226wmb.39.1693325733178; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 09/12] gdbstub: remove unused user_ctx field Date: Tue, 29 Aug 2023 17:15:25 +0100 Message-Id: <20230829161528.2707696-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325820477100004 This was always NULL so drop it. Message-Id: <20230824163910.1737079-10-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Acked-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index e7d48fa0d4..8e9bc17e07 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -836,7 +836,7 @@ static inline int startswith(const char *string, const = char *pattern) return !strncmp(string, pattern, strlen(pattern)); } =20 -static int process_string_cmd(void *user_ctx, const char *data, +static int process_string_cmd(const char *data, const GdbCmdParseEntry *cmds, int num_cmds) { int i; @@ -863,7 +863,7 @@ static int process_string_cmd(void *user_ctx, const cha= r *data, } =20 gdbserver_state.allow_stop_reply =3D cmd->allow_stop_reply; - cmd->handler(params, user_ctx); + cmd->handler(params, NULL); return 0; } =20 @@ -881,7 +881,7 @@ static void run_cmd_parser(const char *data, const GdbC= mdParseEntry *cmd) =20 /* In case there was an error during the command parsing we must * send a NULL packet to indicate the command is not supported */ - if (process_string_cmd(NULL, data, cmd, 1)) { + if (process_string_cmd(data, cmd, 1)) { gdb_put_packet(""); } } @@ -1394,7 +1394,7 @@ static void handle_v_commands(GArray *params, void *u= ser_ctx) return; } =20 - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_v_commands_table, ARRAY_SIZE(gdb_v_commands_table))) { gdb_put_packet(""); @@ -1738,13 +1738,13 @@ static void handle_gen_query(GArray *params, void *= user_ctx) return; } =20 - if (!process_string_cmd(NULL, get_param(params, 0)->data, + if (!process_string_cmd(get_param(params, 0)->data, gdb_gen_query_set_common_table, ARRAY_SIZE(gdb_gen_query_set_common_table))) { return; } =20 - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_gen_query_table, ARRAY_SIZE(gdb_gen_query_table))) { gdb_put_packet(""); @@ -1757,13 +1757,13 @@ static void handle_gen_set(GArray *params, void *us= er_ctx) return; } =20 - if (!process_string_cmd(NULL, get_param(params, 0)->data, + if (!process_string_cmd(get_param(params, 0)->data, gdb_gen_query_set_common_table, ARRAY_SIZE(gdb_gen_query_set_common_table))) { return; } =20 - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_gen_set_table, ARRAY_SIZE(gdb_gen_set_table))) { gdb_put_packet(""); --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325969; cv=none; d=zohomail.com; s=zohoarc; b=C3U+Z9nhamGd+BnUxdcSD6w/PKKVo5Yx6qEu+OOXUpJ7JENqhd3g6jhXpw3c6weTX3s0ogdoweLSQA3GiQBS+xRm7wYbMww4L+h6th8tiETvJxJIueXj7iP58SZvEfV5njNSbPbSZmxumQb3xU+CwtcJjUDsswP+JZgHtW101M0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325969; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; b=XHWlmQ13UXTmjEtP/pYePhd0ySP70wwzawu+GjqT+Hyp6Fi3FOkqPX+qR3HDZMij1UkwvfkoxNJUSY0IxdjCb1UDrfbQwl1HkdzK/g+vx943zxfOXePpNElcySWMBZUFzpQOVU73z6MqYQGB9H+wCWqIkCVTG4999D7RjVTK5e8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325969205704.6796248779162; Tue, 29 Aug 2023 09:19:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1Nq-00059M-Nv; Tue, 29 Aug 2023 12:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nk-0004zI-1t for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004Qn-Qf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:55 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fef56f7223so41377755e9.3 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m9-20020a7bcb89000000b003fee777fd84sm14309471wmi.41.2023.08.29.09.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 681B11FFBC; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; b=ZkemELLTwaRba0RloTHPtfkxAVroB/+6wJhKBgaKY+4/I+ckfY1JLV06QjsuUIKYHW g2MhgyDaE0+Y7huDAFwzkMQDg7N1UdwXAetKrBZBMMal1Cg7jUqW/tga8fH1iymqbCsw LmJX1vgQXdgU+Xeor8nr5OwdLmgZp8Iir9le4oLqyPrbCn1lBQK4QVdFTs4xmovtcDwV FWZ89Z7Mizwmissg2CIfK8ePo7AnF0YqfA6cQGy+RLMTlAIC0GC+xfEmxOQEhB2kc3ZL VBcr7RqN4hrsOSntNLPLCZlwVxu6gvsn2WqF2Nb9TniFqRaA1rVRRn0d6zlwG3FpG3Gk Xd/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; b=hiFtC/aMmSzFbBoaDpwox3ODAril276HP6k5M/OSw/bbtmRwo1kdSzhm9xfXTrK2KG Z5qpgFC9DaUR13Kh/FbbB0HTJXySyf2nbyK8jiSXMZ1PMQE0OvKWPKQfB3fnWLCxFLx5 ftADuEON7GnFaeeyu6e3Gie5JQV4GGmm5mXE3PWT+0oqwVXEUjpsYlYLbjbNlLk5R7iH aP80DwyT23ZhW8pJql/2Ibe9/HYgsPUTmmzDo0D5UAzBbCnU0LBeB2w1V5KKpR+/2UMA d/Q7FBUIJZsxm0X0MxLPVq2f9iUvrRbFIfPdKi1tkiGKaEYqx8yIuAYRuiXl14USrnH7 rLWg== X-Gm-Message-State: AOJu0YxHd9wJmnDSr9RQKKB0MroO1cs9at489HSw0vNjQMWlKu+IgIk0 yHVmsVz6hdNNdNvr/d8KrtETFw== X-Google-Smtp-Source: AGHT+IFwfty2v0xOF9CMsFRfCAdFBAmU9R4tfu/jx0PdvIzN1aFXk/KBUSok+h9UvLdGJqq1tbAcuQ== X-Received: by 2002:a1c:7303:0:b0:3fb:f0ef:4669 with SMTP id d3-20020a1c7303000000b003fbf0ef4669mr21407138wmb.17.1693325733334; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 10/12] gdbstub: refactor get_feature_xml Date: Tue, 29 Aug 2023 17:15:26 +0100 Message-Id: <20230829161528.2707696-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325970871100007 Try to bring up the code to more modern standards by: - use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls - don't hand hack strstr to find the delimiter - fix up style of xml_builtin and invert loop Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v3 - also clean-up xml_builtin loop - use strchr and defere copy for only xml case v2 - avoid needless g_strndup for copy of annex --- gdbstub/internals.h | 2 +- gdbstub/gdbstub.c | 81 +++++++++++++++++++++++---------------------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index f2b46cce41..4876ebd74f 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -33,7 +33,7 @@ typedef struct GDBProcess { uint32_t pid; bool attached; =20 - char target_xml[1024]; + char *target_xml; } GDBProcess; =20 enum RSState { diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 8e9bc17e07..729e54139a 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -354,64 +354,67 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t t= id) static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { - size_t len; - int i; - const char *name; CPUState *cpu =3D gdb_get_first_cpu_in_process(process); CPUClass *cc =3D CPU_GET_CLASS(cpu); + size_t len; =20 - len =3D 0; - while (p[len] && p[len] !=3D ':') - len++; - *newp =3D p + len; + /* + * qXfer:features:read:ANNEX:OFFSET,LENGTH' + * ^p ^newp + */ + char *term =3D strchr(p, ':'); + *newp =3D term + 1; + len =3D term - p; =20 - name =3D NULL; + /* Is it the main target xml? */ if (strncmp(p, "target.xml", len) =3D=3D 0) { - char *buf =3D process->target_xml; - const size_t buf_sz =3D sizeof(process->target_xml); - - /* Generate the XML description for this CPU. */ - if (!buf[0]) { + if (!process->target_xml) { GDBRegisterState *r; + GString *xml =3D g_string_new(""); + + g_string_append(xml, + "" + ""); =20 - pstrcat(buf, buf_sz, - "" - "" - ""); if (cc->gdb_arch_name) { - gchar *arch =3D cc->gdb_arch_name(cpu); - pstrcat(buf, buf_sz, ""); - pstrcat(buf, buf_sz, arch); - pstrcat(buf, buf_sz, ""); - g_free(arch); + g_autofree gchar *arch =3D cc->gdb_arch_name(cpu); + g_string_append_printf(xml, + "%s", + arch); } - pstrcat(buf, buf_sz, "gdb_core_xml_file); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "gdb_core_xml_file); + g_string_append(xml, "\"/>"); for (r =3D cpu->gdb_regs; r; r =3D r->next) { - pstrcat(buf, buf_sz, "xml); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "xml); + g_string_append(xml, "\"/>"); } - pstrcat(buf, buf_sz, ""); + g_string_append(xml, ""); + + process->target_xml =3D g_string_free(xml, false); + return process->target_xml; } - return buf; } + /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { - char *xmlname =3D g_strndup(p, len); + g_autofree char *xmlname =3D g_strndup(p, len); const char *xml =3D cc->gdb_get_dynamic_xml(cpu, xmlname); - - g_free(xmlname); if (xml) { return xml; } } - for (i =3D 0; ; i++) { - name =3D xml_builtin[i][0]; - if (!name || (strncmp(name, p, len) =3D=3D 0 && strlen(name) =3D= =3D len)) - break; + /* Is it one of the encoded gdb-xml/ files? */ + for (int i =3D 0; xml_builtin[i][0]; i++) { + const char *name =3D xml_builtin[i][0]; + if ((strncmp(name, p, len) =3D=3D 0) && + strlen(name) =3D=3D len) { + return xml_builtin[i][1]; + } } - return name ? xml_builtin[i][1] : NULL; + + /* failed */ + return NULL; } =20 static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) @@ -2245,6 +2248,6 @@ void gdb_create_default_process(GDBState *s) process =3D &s->processes[s->process_num - 1]; process->pid =3D pid; process->attached =3D false; - process->target_xml[0] =3D '\0'; + process->target_xml =3D NULL; } =20 --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325923; cv=none; d=zohomail.com; s=zohoarc; b=RazXE0Ru1GVRrKiQaHAsTtEU1Opz3YvyYseTsNiNjEpzZFJhTKszryooC/YSIBYuhx79pXXwlax09M3j5wnxtN8/T3Jq0jcnTc4YW+ok8HtQ4kJ7zQ6lJF5ltaqtfAUeDePKvjaGVXTp875IszVNpiSxc+ma7oj9sDZroI4f0/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325923; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; b=IGDIwom7KnXXmcvXA6nO1REcvLDnHTbXoagqTjHEhCdQRMFBTNv96xe/jft+dqrxMn9AICvAEXF/X4yH0dYI6TFYF/+lywHK9X5wxNe/eLpHUwsQqmblRMryDewYqSVGoHdhVDQkrsp+QScwI+3hZj2ptQze5qEN07czRlbXfVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325923817644.3550870954892; Tue, 29 Aug 2023 09:18:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1No-00055s-Um; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nd-0004qy-PR for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:51 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NR-0004Rn-5n for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:47 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31c8a710545so2783924f8f.3 for ; Tue, 29 Aug 2023 09:15:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z12-20020adff1cc000000b00317f29ad113sm14208277wro.32.2023.08.29.09.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F3EF1FFBD; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325734; x=1693930534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; b=MDXHc7/86yBaD41yaQCelIhjePy7PUC23souAJuYNbOldyIT0tcoHwVXOtu09kTvAT 5e2xsOJHfBveqlK4+UvVdn9shERcXnyYmwj4eCNOKliRj0Dy3DEJ9HAb2QY0SU22LVfA jbIrJRMNBrcHDEQB52Pg5jfRd82S+dFk36R6iK/JULIrui5lpvmq/ncWhQR+/pfZI8mo 6nHFVoTkalZANi6qihqOl5fwc58rwP1FH43BykKzQhyRPXzR8V2egbreIXrC9682F5vw 40KRTa3ner5NKUbnmTunsWbY7DaQpdDxHYBXxODj/nVARlJVoJWheQAcZ/FlO3uiUpqC h4nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325734; x=1693930534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; b=A8Rqn+PlQkMeq03HbAQEtRpGQ1zKlZ7eCdNoIe93hjQMt8Nem5K1WCpdpSMVYKWNFz LtcZdzkHX8WhRZ4BeHVmBVtZgij6/0dF2bhFW+cMy4ru56jy5vTPphuAU2vBwFAqrhAT CwJupXQzRB15T8CIxtkI88JOHtdzLuV2QCleQIepqamX0TOwbWqp3xP0FSdeuEPEaODa annyRF1QWqpVn4RxLUiO/jtsuiKJ0DpzBJDf31qqu8B213WmRyEMoAN6WhlByV1pGy6Z xEf5Nzi6aTwAJcDq4nyjYWScUv4oe5haxzcCenW8sgbcGW51PgSbfMF942UuqmvMDO3W 6SUA== X-Gm-Message-State: AOJu0YyKBJjt8ZnLmjLQm2WBAX532twbp6cf6/SOfgsAIAQE6jdyZrbi JYH6/gKNp4VVu9C4q3mzQzgDrw== X-Google-Smtp-Source: AGHT+IE3PGGWV+Jz/2BmdBxzGbvd6ZvFdX3y9F5nZZ3lQHM9RnVLItahWZu9XceEJc2wCQjd7Y5x4A== X-Received: by 2002:a5d:604d:0:b0:319:71f7:2427 with SMTP id j13-20020a5d604d000000b0031971f72427mr23584258wrt.66.1693325734496; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 11/12] gdbstub: replace global gdb_has_xml with a function Date: Tue, 29 Aug 2023 17:15:27 +0100 Message-Id: <20230829161528.2707696-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325925050100005 Try and make the self reported global hack a little less hackish by providing a query function instead. As gdb_has_xml was always set if we negotiated XML we can now use the presence of ->target_xml as the test instead. Message-Id: <20230824163910.1737079-12-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- gdbstub/internals.h | 1 + include/exec/gdbstub.h | 10 +++++----- gdbstub/gdbstub.c | 12 +++++++----- gdbstub/softmmu.c | 1 - gdbstub/user.c | 1 - target/arm/gdbstub.c | 8 ++++---- target/ppc/gdbstub.c | 4 ++-- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 4876ebd74f..fee243081f 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -33,6 +33,7 @@ typedef struct GDBProcess { uint32_t pid; bool attached; =20 + /* If gdb sends qXfer:features:read:target.xml this will be populated = */ char *target_xml; } GDBProcess; =20 diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 7d743fe1e9..0ee39cfdd1 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -31,12 +31,12 @@ int gdbserver_start(const char *port_or_device); void gdb_set_stop_cpu(CPUState *cpu); =20 /** - * gdb_has_xml: - * This is an ugly hack to cope with both new and old gdb. - * If gdb sends qXfer:features:read then assume we're talking to a newish - * gdb that understands target descriptions. + * gdb_has_xml() - report of gdb supports modern target descriptions + * + * This will report true if the gdb negotiated qXfer:features:read + * target descriptions. */ -extern bool gdb_has_xml; +bool gdb_has_xml(void); =20 /* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ extern const char *const xml_builtin[][2]; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 729e54139a..fdebfe25ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -75,8 +75,6 @@ void gdb_init_gdbserver_state(void) gdbserver_state.sstep_flags &=3D gdbserver_state.supported_sstep_flags; } =20 -bool gdb_has_xml; - /* writes 2*len+1 bytes in buf */ void gdb_memtohex(GString *buf, const uint8_t *mem, int len) { @@ -351,6 +349,11 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t ti= d) } } =20 +bool gdb_has_xml(void) +{ + return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml; +} + static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { @@ -1084,7 +1087,7 @@ static void handle_set_reg(GArray *params, void *user= _ctx) { int reg_size; =20 - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1105,7 +1108,7 @@ static void handle_get_reg(GArray *params, void *user= _ctx) { int reg_size; =20 - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1572,7 +1575,6 @@ static void handle_query_xfer_features(GArray *params= , void *user_ctx) return; } =20 - gdb_has_xml =3D true; p =3D get_param(params, 0)->data; xml =3D get_feature_xml(p, &p, process); if (!xml) { diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index f509b7285d..9f0b8b5497 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -97,7 +97,6 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent even= t) =20 vm_stop(RUN_STATE_PAUSED); replay_gdb_attached(); - gdb_has_xml =3D false; break; default: break; diff --git a/gdbstub/user.c b/gdbstub/user.c index 5b375be1d9..7ab6e5d975 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -198,7 +198,6 @@ static void gdb_accept_init(int fd) gdbserver_state.c_cpu =3D gdb_first_attached_cpu(); gdbserver_state.g_cpu =3D gdbserver_state.c_cpu; gdbserver_user_state.fd =3D fd; - gdb_has_xml =3D false; } =20 static bool gdb_accept_socket(int gdb_fd) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index f421c5d041..8fc8351df7 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -48,7 +48,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *m= em_buf, int n) } if (n < 24) { /* FPA registers. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_zeroes(mem_buf, 12); @@ -56,7 +56,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *m= em_buf, int n) switch (n) { case 24: /* FPA status register. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_reg32(mem_buf, 0); @@ -102,7 +102,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *m= em_buf, int n) } if (n < 24) { /* 16-23 */ /* FPA registers (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 12; @@ -110,7 +110,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *m= em_buf, int n) switch (n) { case 24: /* FPA status register (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 4; diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index ca39efdc35..2ad11510bf 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -56,7 +56,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 32 ... 63: /* fprs */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 8; @@ -76,7 +76,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 70: /* fpscr */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return sizeof(target_ulong); --=20 2.39.2 From nobody Wed May 15 09:36:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693325940; cv=none; d=zohomail.com; s=zohoarc; b=RkRmNspycDHKMobyoJQbwT8O5OeeeH3XWqMxF9g5csgTMfeWN8rljyLCHKxoNBOgmuVv4PhI+lpELx+fRGAdJq5+JiE4QaCla87qXhzvjtQCvFUf6BRJuzEKuKz/M+NKJ633/IwDfgFvmudPZvm+mcLSAM+nheC/Ba9AfEq2SXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693325940; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; b=XRIhg7sekhcM2gE3uRvxziOtWe/PXIZyNtJFZ7Wng++3k9w2aWdZZSBAz2BqtG9iSPRtRfB3SgrLD52QkrI1Ir0Fd8LnOXCEb4HeOf2UEBx1QPRnd/1TQn+VC39dGdPOi1DOTvsqe4agalBOrqvxCTQ7dUKojnyywUk3eRuUP58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693325940440659.9555543998233; Tue, 29 Aug 2023 09:19:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb1No-00055H-MU; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Na-0004pi-J1 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:47 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NR-0004SD-5Y for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:46 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso4118071f8f.0 for ; Tue, 29 Aug 2023 09:15:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d15-20020a5d538f000000b0031ae8d86af4sm14142002wrv.103.2023.08.29.09.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A8E3F1FFC5; Tue, 29 Aug 2023 17:15:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325735; x=1693930535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; b=oc+Q4mYZf9/YHUG03PttxTVHFvT1xT2vGYHyCh4rrs60RwD91QqzQqpgRs0TKgw2S6 MnVaPRftVh87nHiwrwh1O2JUbaPkskurVoQ5cf8uELspi4IhL/Hi/p0jtV3JFFyOeFCf fVU5RMgkX1BbMRb6onmgbcF2K/sA6/JkavA/R0Ah3zuuncVYW84CV1viVUQBQmbVVTdI JvRRbia7XjmUJmyJZZ5gc95XBiJ/9X6prrmYXRUXoxYWLAVudGtEoBYwXZ/9xXNAkQct zKNhXpBGjmfzTLjszj6j8Bqz74MacONsd+rb84kM3+UFejMp/fdP5GLzTpFOIdRlqFAh MX9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325735; x=1693930535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; b=GCypZo3QfYMsAHyZoQ9MgVaBrL98NBa7OPNEyjZ1NoJmZay9xJwUIxo0Tg0ZI6omzN w+tbmmDsS915TAqP+8YL9wCk5VPSGW0W0wY5q/NGDvFl6XqGhlJytiTdIIfFtwCdgUrd DTdVVdaOwv2udZJr3zJaL2TVSv4HuTiiZsof4kjisvzacOkfpRwMd9fSdMsMkvENYBEs qPpVbCEqx124PYDvvE9DaKNuG0D1A069osSqEJ/rT5YR3GQSzHwzXn3Yu5cFSSdaoGi0 +nZp+Y1WjWkqkkGBxAnimSox/8WeAiOw0py5BTMMedkND/qhWzZfZAlP4lseKjjpnuox qbmg== X-Gm-Message-State: AOJu0Yztf31DWGdUtaF3Unl7OHJucWm8MxgZkebWyEaWhfIA2vEnu8Ez z6WPuk1xR6a9dXEfoUNjYjIzow== X-Google-Smtp-Source: AGHT+IHCS4JuoVmcRH+JpF9nY2Q+pHEFCE0vYYOfX0y1ZYzZMkGZdTpqIm+kz5yrJcEhOjf7LKBRFQ== X-Received: by 2002:adf:f9c4:0:b0:314:420c:5ef7 with SMTP id w4-20020adff9c4000000b00314420c5ef7mr21104043wrr.11.1693325734714; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 12/12] gdbstub: move comment for gdb_register_coprocessor Date: Tue, 29 Aug 2023 17:15:28 +0100 Message-Id: <20230829161528.2707696-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693325941440100001 Use proper kdoc style comments for this API function. Message-Id: <20230824163910.1737079-13-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- include/exec/gdbstub.h | 10 ++++++++++ gdbstub/gdbstub.c | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 0ee39cfdd1..16a139043f 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -14,6 +14,16 @@ /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); + +/** + * gdb_register_coprocessor() - register a supplemental set of registers + * @cpu - the CPU associated with registers + * @get_reg - get function (gdb reading) + * @set_reg - set function (gdb modifying) + * @num_regs - number of registers in set + * @xml - xml name of set + * @gpos - non-zero to append to "general" register set at @gpos + */ void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_r= eg, int num_regs, const char *xml, int g_pos); diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index fdebfe25ea..349d348c7b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -456,12 +456,6 @@ static int gdb_write_register(CPUState *cpu, uint8_t *= mem_buf, int reg) return 0; } =20 -/* Register a supplemental set of CPU registers. If g_pos is nonzero it - specifies the first register number and these registers are included in - a standard "g" packet. Direction is relative to gdb, i.e. get_reg is - gdb reading a CPU register, and set_reg is gdb modifying a CPU register. - */ - void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_r= eg, int num_regs, const char *xml, int g_pos) --=20 2.39.2