From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Gustavo Romero <gustavo.romero@linaro.org>,
qemu-devel@nongnu.org, alex.bennee@linaro.org,
qemu-arm@nongnu.org, manos.pitsidianakis@linaro.org,
peter.maydell@linaro.org
Subject: Re: [PATCH v4 3/9] tests/functional: Provide GDB to the functional tests
Date: Mon, 29 Sep 2025 09:03:22 +0100 [thread overview]
Message-ID: <aNo9JmdYGm0XxU-g@redhat.com> (raw)
In-Reply-To: <acad2462-9c7a-43e9-a40c-6c3d625684c8@redhat.com>
On Mon, Sep 29, 2025 at 08:34:03AM +0200, Thomas Huth wrote:
> On 26/09/2025 20.15, Gustavo Romero wrote:
> > Hi Thomas,
> >
> > On 9/26/25 15:08, Gustavo Romero wrote:
> > > Hi Thomas,
> > >
> > > On 9/26/25 07:03, Thomas Huth wrote:
> > > > On 26/09/2025 07.15, Gustavo Romero wrote:
> > > > > The probe of GDB is done in 'configure' and the full path is passed to
> > > > > meson.build via the -Dgdb=option.
> > > > >
> > > > > Because a single functional test can cover different arches, such as
> > > > > aarch64, ppc64, and x86_64, only a GDB that supports all the arches in
> > > > > the target list is passed to Meson for use in the functional tests. To
> > > > > handle this check, a new shell function, is_target_arch_in_arch_list, is
> > > > > introduced in 'configure'.
> > > > >
> > > > > Meson then can pass the location of GDB to the test via an environment
> > > > > variable: QEMU_TEST_GDB.
> > > > >
> > > > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> > > > > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > > > > ---
> > > > > configure | 21 +++++++++++++++++++++
> > > > > meson_options.txt | 2 ++
> > > > > scripts/meson-buildoptions.sh | 2 ++
> > > > > tests/functional/meson.build | 6 ++++++
> > > > > 4 files changed, 31 insertions(+)
> > > > >
> > > > > diff --git a/configure b/configure
> > > > > index 0f7eb95586..20e05d233f 100755
> > > > > --- a/configure
> > > > > +++ b/configure
> > > > > @@ -1142,12 +1142,31 @@ fi
> > > > > #########################################
> > > > > # gdb test
> > > > > +# Check if all target arches are in a provided list of arches.
> > > > > +is_target_arch_in_arch_list() {
> > > > > + arch_list=$1
> > > > > + for target in $target_list; do
> > > > > + arch=${target%%-*}
> > > > > + if test "${arch_list#*$arch}" = "$arch_list"; then
> > > > > + # Target arch not in arch list
> > > > > + return 1
> > > > > + fi
> > > > > + done
> > > > > + return 0
> > > > > +}
> > > > > +
> > > > > if test -n "$gdb_bin"; then
> > > > > gdb_version_string=$($gdb_bin --version | head -n 1)
> > > > > # Extract last field in the version string
> > > > > gdb_version=${gdb_version_string##* }
> > > > > if version_ge $gdb_version 9.1; then
> > > > > gdb_arches=$($python
> > > > > "$source_path/scripts/probe-gdb- support.py" $gdb_bin)
> > > > > +
> > > > > + if is_target_arch_in_arch_list "$gdb_arches"; then
> > > >
> > > > No TABs, please!
> > > >
> > > > > + gdb_multiarch="yes"
> > > > > + else
> > > > > + gdb_multiarch=""
> > > > > + fi
> > > >
> > > > This unfortunately does not work with the GDB from Fedora - it
> > > > only supports "arch64_be arm riscv64 riscv32 ppc i386 s390x
> > > > ppc64 aarch64 ppc64le x86_64", but if you configured a target
> > > > like "alpha-softmmu", this breaks.
> > >
> > > argh! ok
> > >
> > >
> > > > (BTW, does the gdb-multiarch from Debian/Ubuntu really also
> > > > support exotic QEMU targets like tricore?)
> > >
> > > No, I've checked GDB upstream and I can't see any trace of tricore.
> > > And I just saw that Alex left a comment in scripts/probe-gdb-support.py
> > > saying "# no tricore in upstream gdb", so nope, it seems that it still holds.
> > >
> > >
> > > > I think it would be better to drop this hunk, and rather check
> > > > in the spot where we use GDB if the required target is really
> > > > there (i.e. in the functional test that uses it).
> > >
> > > OK. I'm also not a big fan of doing it in bash. How do you suggest
> > > to do it? Directly in the code, via a skipIf decorator, or something else?
> >
> > $gdb_arches, obtained using scripts/probe-gdb-support.py in configure,
> > could be passed to meson and meson sets it in the test env, as we're
> > doing for $gdb_bin and QEMU_TEST_GDB env var. wdyt?
>
> That might be a possibility, though it's getting a little bit clunky if you
> want to run the test manually, without the meson test runner.
>
> Maybe it would be nicer to just start gdb in the test and catch the error
> (and skip the test in that case) in the python test code if it fails to set
> the target architecture there?
If you run 'set architecture' with no arguments, it'll return a long list
of supported targets we can match on.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-09-29 8:05 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 5:15 [PATCH v4 0/9] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-26 5:15 ` [PATCH v4 1/9] tests/functional: Re-activate the check-venv target Gustavo Romero
2025-09-26 6:28 ` Thomas Huth
2025-09-26 8:34 ` Thomas Huth
2025-09-26 8:37 ` Daniel P. Berrangé
2025-09-26 8:42 ` Thomas Huth
2025-09-26 8:50 ` Daniel P. Berrangé
2025-09-26 15:44 ` Gustavo Romero
2025-09-26 15:47 ` Daniel P. Berrangé
2025-09-26 16:02 ` Gustavo Romero
2025-09-26 15:43 ` Gustavo Romero
2025-09-29 6:26 ` Thomas Huth
2025-09-29 6:29 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 2/9] python: Install pygdbmi in meson's venv Gustavo Romero
2025-09-26 6:28 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 3/9] tests/functional: Provide GDB to the functional tests Gustavo Romero
2025-09-26 10:03 ` Thomas Huth
2025-09-26 18:08 ` Gustavo Romero
2025-09-26 18:15 ` Gustavo Romero
2025-09-29 6:34 ` Thomas Huth
2025-09-29 8:03 ` Daniel P. Berrangé [this message]
2025-09-26 5:15 ` [PATCH v4 4/9] tests/functional: Add GDB class Gustavo Romero
2025-09-26 7:05 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 5/9] tests/functional: replace avocado process with subprocess Gustavo Romero
2025-09-26 7:10 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 6/9] tests/functional: drop datadrainer class in reverse debugging Gustavo Romero
2025-09-26 7:13 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 7/9] tests/functional: Add decorator to skip test on missing env vars Gustavo Romero
2025-09-26 7:20 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 8/9] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-26 8:44 ` Thomas Huth
2025-09-26 16:00 ` Gustavo Romero
2025-09-29 6:24 ` Thomas Huth
2025-09-26 5:15 ` [PATCH v4 9/9] tests/functional: Adapt arches to reverse_debugging " Gustavo Romero
2025-09-26 9:09 ` Thomas Huth
2025-09-26 6:49 ` [PATCH v4 0/9] tests/functional: Adapt reverse_debugging to run " Philippe Mathieu-Daudé
2025-09-26 9:14 ` Thomas Huth
2025-09-26 9:32 ` Philippe Mathieu-Daudé
2025-09-26 9:41 ` Daniel P. Berrangé
2025-09-26 9:42 ` Thomas Huth
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=aNo9JmdYGm0XxU-g@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=gustavo.romero@linaro.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).