All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] target/alpha: Add TCG plugin register tracking support
@ 2025-06-30 16:41 Yodel Eldar
  2025-06-30 16:41 ` [PATCH v2 1/2] contrib/plugins/execlog: Add tab to the separator search of insn_disas Yodel Eldar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yodel Eldar @ 2025-06-30 16:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, richard.henderson, laurent, Yodel Eldar

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
g_strsplit_set, so that the plugin would operate as intended for Alpha.

A pointer in the immediate area of the changed code is converted to a
const pointer 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.

Patch Series History:
v1 -> v2:
  - As suggested by Alex Bennée, replaced strpbrk with g_strsplit_set

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-08 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 16:41 [PATCH v2 0/2] target/alpha: Add TCG plugin register tracking support Yodel Eldar
2025-06-30 16:41 ` [PATCH v2 1/2] contrib/plugins/execlog: Add tab to the separator search of insn_disas Yodel Eldar
2025-06-30 16:41 ` [PATCH v2 2/2] target/alpha: Add GDB XML feature file Yodel Eldar
2025-07-08  7:53 ` [PATCH v2 0/2] target/alpha: Add TCG plugin register tracking support Alex Bennée
2025-07-08 14:48   ` Yodel Eldar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.