From: "Alex Bennée" <alex.bennee@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: Gustavo Romero <gustavo.romero@linaro.org>,
qemu-devel@nongnu.org, berrange@redhat.com,
qemu-arm@nongnu.org
Subject: Re: [PATCH v6 0/9] tests/functional: Adapt reverse_debugging to run w/o Avocado
Date: Mon, 06 Oct 2025 11:13:56 +0100 [thread overview]
Message-ID: <87a5241gnv.fsf@draig.linaro.org> (raw)
In-Reply-To: <8cdf9d77-8801-4c25-93a2-06c81b9d1f3d@redhat.com> (Thomas Huth's message of "Mon, 6 Oct 2025 09:43:15 +0200")
Thomas Huth <thuth@redhat.com> writes:
> On 03/10/2025 16.18, Gustavo Romero wrote:
>> The goal of this series is to remove Avocado as a dependency for running
>> the reverse_debugging functional test.
>> After several rounds of discussions about v1 and v2, and experiments
>> done by Daniel and Thomas (thanks for all the experiments and comments
>> so far), I've taken a new approach and moved away from using a runner
>> for GDB. The changes, I believe, are much simpler now.
>> This new series uses GDB's machine interface (MI) via the pygdbmi
>> module
>> (thanks Manos and Peter for the inputs). pygdbmi provides a controller
>> to start GDB and communicate with it through MI, so there is no longer a
>> risk of version clashes between libpython in GDB and Python modules in
>> the pyvenv, as it could, in theory, happen when GDB executes the test
>> script via -x option.
>> Also, as Daniel pointed out, the overall test output is pretty bad
>> and
>> currently does not allow one to easily follow the sequence of GDB
>> commands used in the test. I took this opportunity to improve the output
>> and it now prints the sequence in a format that can be copied and pasted
>> directly into GDB.
>> The TAP protocol is respected, and Meson correctly displays GDB's
>> test
>> output in testlog-thorough.txt.
>> Because the pygdbmi "shim" is so thin, I had to write a trivial GDB
>> class around it to easily capture and print the payloads returned by its
>> write() method. The GDB class allows clean, single-line commands to be
>> used in the tests through method chaining, making them easier to follow,
>> for example:
>> pc = gdb.cli("print $pc").get_add()
>> The test is kept “skipped” for aarch64, ppc64, and x86_64, so it is
>> necessary to set QEMU_TEST_FLAKY_TESTS=1 in the test environment to
>> effectively run the test on these archs.
>> On aarch64, the test is flaky, but there is a fix that I’ve tested
>> while
>> writing this series [0] that resolves it. On ppc64 and x86_64, the test
>> always fails: on ppc64, GDB gets a bogus PC, and on x86_64, the last
>> part of the test (reverse-continue) does not hit the last executed PC
>> (as it should happen) but instead jumps to the beginning of the code
>> (first PC in forward order).
>> Thus, to effectively run the reverse_debugging test on aarch64:
>> $ export QEMU_TEST_FLAKY_TESTS=1
>> $ make check-functional
>> or:
>> $ make check-functional-aarch64
>> or even, to run only the reverse_debug test after 'make
>> check-functional':
>> $ ./pyvenv/bin/meson test --verbose --no-rebuild -t 1 --setup thorough --suite func-thorough func-aarch64-reverse_debug
>> Cheers,
>> Gustavo
>> v1:
>> https://patchew.org/QEMU/20250819143916.4138035-1-gustavo.romero@linaro.org/
>> v2:
>> https://patchew.org/QEMU/20250904154640.52687-1-gustavo.romero@linaro.org/
>> v3:
>> https://patchew.org/QEMU/20250922054351.14289-1-gustavo.romero@linaro.org/
>> v4:
>> https://patchew.org/QEMU/20250926051542.104432-1-gustavo.romero@linaro.org/
>> v5:
>> https://patchew.org/QEMU/20251002020432.54443-1-gustavo.romero@linaro.org/
>> v6:
>> - Fixed skipping test when no GDB is installed in the test environment
>
> With this v6, the test now gets skipped in my incremental build
> directory, and it works when I compile QEMU in a new folder. I guess
> that's good enough, so from my side, it's fine to include this now:
>
> Tested-by: Thomas Huth <thuth@redhat.com>
>
> Alex, will you queue the patches?
Yep - I'm just doing the final checks with my personal gitlab runners
before posting.
>
> Thomas
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
prev parent reply other threads:[~2025-10-06 10:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 14:18 [PATCH v6 0/9] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 1/9] tests/functional: Re-activate the check-venv target Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 2/9] python: Install pygdbmi in meson's venv Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 3/9] tests/functional: Provide GDB to the functional tests Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 4/9] tests/functional: Add GDB class Gustavo Romero
2025-10-06 6:30 ` Thomas Huth
2025-10-06 10:13 ` Alex Bennée
2025-10-03 14:18 ` [PATCH v6 5/9] tests/functional: replace avocado process with subprocess Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 6/9] tests/functional: drop datadrainer class in reverse debugging Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 7/9] tests/functional: Add decorator to skip test on missing env vars Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 8/9] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-10-03 14:18 ` [PATCH v6 9/9] tests/functional: Adapt arches to reverse_debugging " Gustavo Romero
2025-10-06 7:43 ` [PATCH v6 0/9] tests/functional: Adapt reverse_debugging to run " Thomas Huth
2025-10-06 10:13 ` Alex Bennée [this message]
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=87a5241gnv.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=gustavo.romero@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).