From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Gustavo Romero" <gustavo.romero@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 10/17] tests/functional: Provide GDB to the functional tests
Date: Tue, 7 Oct 2025 12:55:18 +0100 [thread overview]
Message-ID: <20251007115525.1998643-11-alex.bennee@linaro.org> (raw)
In-Reply-To: <20251007115525.1998643-1-alex.bennee@linaro.org>
From: Gustavo Romero <gustavo.romero@linaro.org>
The probe of GDB is done in 'configure' and the full path is passed to
meson.build via the -Dgdb=option.
Meson then can pass the location of GDB to the functional tests via an
environment variable: QEMU_TEST_GDB.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-ID: <20251003141820.85278-4-gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
diff --git a/configure b/configure
index 78445cbb4b3..21d1679f58e 100755
--- a/configure
+++ b/configure
@@ -2003,6 +2003,8 @@ if test "$skip_meson" = no; then
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$plugins" = yes && meson_option_add "-Dplugins=true"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
+ test -n "$gdb_bin" && meson_option_add "-Dgdb=$gdb_bin"
+
run_meson() {
NINJA=$ninja $meson setup "$@" "$PWD" "$source_path"
}
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')
# 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 sanitizer'
printf "%s\n" ' --firmwarepath=VALUES search PATH for firmware files [share/qemu-'
printf "%s\n" ' firmware]'
+ printf "%s\n" ' --gdb=VALUE Path to GDB'
printf "%s\n" ' --iasl=VALUE Path to ACPI disassembler'
printf "%s\n" ' --includedir=VALUE Header file directory [include]'
printf "%s\n" ' --interp-prefix=VALUE where to find shared libraries etc., use %M for'
@@ -323,6 +324,7 @@ _meson_option_parse() {
--disable-fuzzing) printf "%s" -Dfuzzing=false ;;
--enable-gcrypt) printf "%s" -Dgcrypt=enabled ;;
--disable-gcrypt) printf "%s" -Dgcrypt=disabled ;;
+ --gdb=*) quote_sh "-Dgdb=$2" ;;
--enable-gettext) printf "%s" -Dgettext=enabled ;;
--disable-gettext) printf "%s" -Dgettext=disabled ;;
--enable-gio) printf "%s" -Dgio=enabled ;;
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 2a0c5aa1418..725630d3082 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())
+ # Define the GDB environment variable if gdb is available.
+ gdb = get_option('gdb')
+ if gdb != ''
+ test_env.set('QEMU_TEST_GDB', gdb)
+ endif
+
foreach test : target_tests
testname = '@0@-@1@'.format(target_base, test)
if fs.exists('generic' / 'test_' + test + '.py')
--
2.47.3
next prev parent reply other threads:[~2025-10-07 11:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 11:55 [PULL 00/17] testing updates Alex Bennée
2025-10-07 11:55 ` [PULL 01/17] .gitpublish: use origin/master as default base Alex Bennée
2025-10-07 11:55 ` [PULL 02/17] .gitmodules: restore qemu-project mirror of u-boot Alex Bennée
2025-10-07 11:55 ` [PULL 03/17] .gitmodules: restore qemu-project mirror of u-boot-sam460ex Alex Bennée
2025-10-07 11:55 ` [PULL 04/17] tests/lcitool: drop 64 bit guests from i686 cross build Alex Bennée
2025-10-07 11:55 ` [PULL 05/17] tests/lcitool: bump custom runner packages to Ubuntu 24.04 Alex Bennée
2025-10-07 11:55 ` [PULL 06/17] gitlab: move custom runners " Alex Bennée
2025-10-07 11:55 ` [PULL 07/17] scripts/ci: use recommended registration command Alex Bennée
2025-10-07 11:55 ` [PULL 08/17] tests/functional: Re-activate the check-venv target Alex Bennée
2025-10-07 11:55 ` [PULL 09/17] python: Install pygdbmi in meson's venv Alex Bennée
2025-10-07 11:55 ` Alex Bennée [this message]
2025-10-07 11:55 ` [PULL 11/17] tests/functional: Add GDB class Alex Bennée
2025-10-07 11:55 ` [PULL 12/17] tests/functional: replace avocado process with subprocess Alex Bennée
2025-10-07 11:55 ` [PULL 13/17] tests/functional: drop datadrainer class in reverse debugging Alex Bennée
2025-10-07 11:55 ` [PULL 14/17] tests/functional: Add decorator to skip test on missing env vars Alex Bennée
2025-10-07 11:55 ` [PULL 15/17] tests/functional: Adapt reverse_debugging to run w/o Avocado Alex Bennée
2025-10-07 11:55 ` [PULL 16/17] tests/functional: Adapt arches to reverse_debugging " Alex Bennée
2025-10-07 11:55 ` [PULL 17/17] record/replay: fix race condition on test_aarch64_reverse_debug Alex Bennée
2025-10-07 22:58 ` [PULL 00/17] testing updates Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251007115525.1998643-11-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=gustavo.romero@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).