From nobody Sun Sep 28 17:40:23 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757940294; cv=none; d=zohomail.com; s=zohoarc; b=ikfIMtBfLBg5aPYxKvCkFeE/SLVhdgtWZ+JJl+KYj9EDeMebE6HzZv6ifNInIZHAyDoj09a8/5UAgzydONu93BMqPM4oUB0zcjIjaPWEHJ4OuldJnWYBjTjkBpaTka3vfhZ/DQvXkzg37CMVUAEO+03Vunjn3A8cZHsQEEF7+yY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757940294; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZKHsG78MwPt6fpuDAGzV32Z3lVcZm9X5X3E7GGbeIo0=; b=CGtYfOaXRuS2ko/SUjCXo7m4xGv0bV5aXhZ1QuPdqkC0SkFjaCz6NwDF89GlCWZJvmXqXUWfh+d9/pMPzLWH7M9H1DOin8PstypCnb57UGBQL58qOCL1j541m2Vsj7XSeQfddvrByTfJCxBb3nEfIa07O1PMLce9vSnTRw1Rgfg= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1757940292219311.0369898002326; Mon, 15 Sep 2025 05:44:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uy8Xi-00021q-Ia; Mon, 15 Sep 2025 08:42:50 -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 1uy8XZ-0001zM-3c for qemu-devel@nongnu.org; Mon, 15 Sep 2025 08:42:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uy8XJ-00022U-9T for qemu-devel@nongnu.org; Mon, 15 Sep 2025 08:42:39 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-47-sces1KHsOka5TZ0erceyeQ-1; Mon, 15 Sep 2025 08:42:15 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7543B1956050; Mon, 15 Sep 2025 12:42:14 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.128]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8508A180044F; Mon, 15 Sep 2025 12:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757940139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZKHsG78MwPt6fpuDAGzV32Z3lVcZm9X5X3E7GGbeIo0=; b=aNM8Bn8hsDHJiiaKPdTdl3hTSRUoX5nDA4HxvBfvkCxiCMyjXJ/JtlPB94GNf8YALJJhil ziK3+6Y5JZreTmlfwWKrPJ42z9ysBLL9kapwMXIuiupXpCFxzqXJFrcC+kMOoLBDeboewR bR9YM5sZaD7W/NTx9+0vjOt8GenZj8U= X-MC-Unique: sces1KHsOka5TZ0erceyeQ-1 X-Mimecast-MFC-AGG-ID: sces1KHsOka5TZ0erceyeQ_1757940134 From: Thomas Huth To: Gustavo Romero , qemu-devel@nongnu.org, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Cc: qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [RFC PATCH 1/2] tests/functional: Provide GDB to the functional tests Date: Mon, 15 Sep 2025 14:42:06 +0200 Message-ID: <20250915124207.42053-2-thuth@redhat.com> In-Reply-To: <20250915124207.42053-1-thuth@redhat.com> References: <20250915124207.42053-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1757940301572116600 Content-Type: text/plain; charset="utf-8" From: Gustavo Romero The probe of gdb is done in 'configure' and the full path is passed to meson.build via the -Dgdb=3Doption. meson then can pass the location of gdb to the test via an environment variable. This patch is based on an earlier patch ("Support tests that require a runner") by Gustavo Romero. Signed-off-by: Thomas Huth Reviewed-by: Alex Benn=C3=A9e --- configure | 2 ++ meson.build | 4 ++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 2 ++ tests/functional/meson.build | 7 +++++++ 5 files changed, 17 insertions(+) diff --git a/configure b/configure index 274a7787642..8e2e2cd562a 100755 --- a/configure +++ b/configure @@ -1978,6 +1978,8 @@ if test "$skip_meson" =3D no; then test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engin= e=3D$LIB_FUZZING_ENGINE" test "$plugins" =3D yes && meson_option_add "-Dplugins=3Dtrue" test "$tcg" !=3D enabled && meson_option_add "-Dtcg=3D$tcg" + test -n "$gdb_bin" && meson_option_add "-Dgdb=3D$gdb_bin" + run_meson() { NINJA=3D$ninja $meson setup "$@" "$PWD" "$source_path" } diff --git a/meson.build b/meson.build index 3d738733566..4cbc3c8ac65 100644 --- a/meson.build +++ b/meson.build @@ -75,6 +75,10 @@ have_user =3D have_linux_user or have_bsd_user =20 sh =3D find_program('sh') python =3D import('python').find_installation() +# Meson python.get_path() on 'purelib' or 'platlib' doesn't properly retur= n the +# site-packages dir in pyvenv, so it is built manually. +python_ver =3D python.language_version() +python_site_packages =3D meson.build_root() / 'pyvenv/lib/python' + python= _ver / 'site-packages' =20 cc =3D meson.get_compiler('c') all_languages =3D ['c'] diff --git a/meson_options.txt b/meson_options.txt index fff1521e580..5bb41bcbc43 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,6 +36,8 @@ option('trace_file', type: 'string', value: 'trace', option('coroutine_backend', type: 'combo', choices: ['ucontext', 'sigaltstack', 'windows', 'wasm', 'auto'], value: 'auto', description: 'coroutine backend to use') +option('gdb', type: 'string', value: '', + description: 'Path to GDB') =20 # Everything else can be set via --enable/--disable-* option # on the configure script command line. After adding an option diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 0ebe6bc52a6..f4bd21220ee 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -58,6 +58,7 @@ meson_options_help() { printf "%s\n" ' --enable-ubsan enable undefined behaviour san= itizer' printf "%s\n" ' --firmwarepath=3DVALUES search PATH for firmware fil= es [share/qemu-' printf "%s\n" ' firmware]' + printf "%s\n" ' --gdb=3DVALUE Path to GDB' printf "%s\n" ' --iasl=3DVALUE Path to ACPI disassembler' printf "%s\n" ' --includedir=3DVALUE Header file directory [inclu= de]' printf "%s\n" ' --interp-prefix=3DVALUE where to find shared librari= es etc., use %M for' @@ -323,6 +324,7 @@ _meson_option_parse() { --disable-fuzzing) printf "%s" -Dfuzzing=3Dfalse ;; --enable-gcrypt) printf "%s" -Dgcrypt=3Denabled ;; --disable-gcrypt) printf "%s" -Dgcrypt=3Ddisabled ;; + --gdb=3D*) quote_sh "-Dgdb=3D$2" ;; --enable-gettext) printf "%s" -Dgettext=3Denabled ;; --disable-gettext) printf "%s" -Dgettext=3Ddisabled ;; --enable-gio) printf "%s" -Dgio=3Denabled ;; diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 2a0c5aa1418..c822eb66309 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -77,6 +77,12 @@ foreach speed : ['quick', 'thorough'] test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' + meson.current_source_dir()) =20 + # Define the GDB environment variable if gdb is available. + gdb =3D get_option('gdb') + if gdb !=3D '' + test_env.set('QEMU_TEST_GDB', gdb) + endif + foreach test : target_tests testname =3D '@0@-@1@'.format(target_base, test) if fs.exists('generic' / 'test_' + test + '.py') @@ -121,6 +127,7 @@ foreach speed : ['quick', 'thorough'] priority: time_out, suite: suites) endforeach + endforeach endforeach =20 --=20 2.51.0