From: Yodel Eldar <yodel.eldar@gmail.com>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, richard.henderson@linaro.org,
laurent@vivier.eu, Yodel Eldar <yodel.eldar@gmail.com>
Subject: [PATCH 0/2] target/alpha: Add TCG plugin register tracking support
Date: Fri, 27 Jun 2025 15:47:57 -0500 [thread overview]
Message-ID: <20250627204817.47595-1-yodel.eldar@gmail.com> (raw)
This patch adds TCG plugin register tracking support for the Alpha
target and resolves gitlab issue #2569:
https://gitlab.com/qemu-project/qemu/-/issues/2569
As mentioned in the bug report by Alex Bennée, the register list is
built using the target's corresponding GDB XML feature file, but the
Alpha target does not have one. The second patch introduces the missing
feature file and the necessary plumbing for it.
While testing the second patch, I noticed the following error:
qemu-alpha: GLib: g_strrstr: assertion 'haystack != NULL' failed
when running:
./qemu-alpha -d plugin \
-plugin ./contrib/plugins/libexeclog.so,reg=*,rdisas=on \
./tests/tcg/alpha-linux-user/linux-test
and discovered an issue with execlog.c that the first patch resolves:
a missing null check after execlog searches a disassembled instruction
for a space separator between the mnemonic and the operands. Execlog
assumes that disassembled instructions will contain a space, but some
disassemblers use tabs (like Alpha).
Besides adding the null check, the execlog patch also adds tab to the
separator search by replacing the g_strstr_len call with a call to
strpbrk, so that the plugin would operate as intended for Alpha.
Two pointers in the immediate area of the changed code were converted to
const pointers in keeping with the QEMU Coding Style. Also, as a trivial
optimization, I took the liberty of adding a break statement to the
register search loop that immediately follows the separator search, so
that it breaks out of the loop as soon as a relevant register is found
in the instruction; please let me know if either of these minor changes
should be moved to a separate patch file.
Lastly, this is my first submission to QEMU, and I want to thank
every past, present, and future contributor to this project that has
kept my system secure as I tinker with weird machines in the ultimate
sandbox. QEMU is truly mind-blowing technology, and I have all of
you to thank for it: Thanks!
Yodel Eldar (2):
contrib/plugins/execlog: Add tab to the separator search of insn_disas
target/alpha: Add GDB XML feature file
configs/targets/alpha-linux-user.mak | 1 +
configs/targets/alpha-softmmu.mak | 1 +
contrib/plugins/execlog.c | 15 +--
gdb-xml/alpha-core.xml | 136 +++++++++++++++++++++++++++
target/alpha/cpu.c | 1 +
5 files changed, 148 insertions(+), 6 deletions(-)
create mode 100644 gdb-xml/alpha-core.xml
--
2.50.0
next reply other threads:[~2025-06-27 20:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 20:47 Yodel Eldar [this message]
2025-06-27 20:47 ` [PATCH 1/2] contrib/plugins/execlog: Add tab to the separator search of insn_disas Yodel Eldar
2025-06-29 18:50 ` Alex Bennée
2025-06-29 22:49 ` Yodel Eldar
2025-06-30 8:42 ` Alex Bennée
2025-06-27 20:47 ` [PATCH 2/2] target/alpha: Add GDB XML feature file Yodel Eldar
2025-06-28 10:09 ` 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=20250627204817.47595-1-yodel.eldar@gmail.com \
--to=yodel.eldar@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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).