All of lore.kernel.org
 help / color / mirror / Atom feed
* ppc-linux-user GDB stub broken
@ 2026-02-27  8:28 Florian Hofhammer
  2026-02-27  9:58 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 11+ messages in thread
From: Florian Hofhammer @ 2026-02-27  8:28 UTC (permalink / raw)
  To: qemu-ppc; +Cc: Pierrick Bouvier, philmd, qemu-devel

Hello,

on current master (d8a9d97317d03190b34498741f98f22e2a9afe3e), the basic
gdb stub test fails for ppc-linux-user when running "make check-tcg".
The error message is as follows:
      TEST    basic gdbstub support on ppc
    Python Exception <class 'gdb.error'>: Could not fetch register "fpscr"; remote failure reply '14'
    Error occurred in Python: Could not fetch register "fpscr"; remote failure reply '14'
    qemu-ppc: QEMU: Terminated via GDBstub
I've tested from a clean checkout with the following commands:
    ./configure --target-list=ppc-linux-user
    make -j$(nproc) all
    make check-tcg

According to git bisect, the test started failing with commit
1ec0fbe2ddadf17f7e0644b441833f0cd20dc137, which reduced
cc->gdb_num_core_regs from 71 to 70 (link to the patch on the mailing
list: https://lists.nongnu.org/archive/html/qemu-ppc/2026-02/msg00265.html).
Commit 7ddd3aca5f2efcf6aae10f836011e445ee77a6e1 (mailing list link:
https://lists.nongnu.org/archive/html/qemu-ppc/2026-02/msg00267.html)
got rid of the hardcoded value for cc->gdb_num_core_regs, but the test
still fails (people involved in the original patches in CC).

I've debugged around a bit but I don't know my way around the gdbstub
internals enough to propose a patch right away, so I'll just summarize
what I figured out so far.
1. Due to cc->gdb_num_core_regs not being set explicitly anymore, it is
   set to 0 at the end of gdbstub/gdbstub.c:gdb_init_cpu(). In the same
   function, cpu->gdb_num_regs gets set to 70.
2. When the test tries to read a register in gdbstub/gdbstub.c:gdb_read_register(),
   the first condition of "reg < cc->gdb_num_core_regs" is always false.
   Also, the register number for fpscr passed to the function is is 103,
   and cpu->gdb_num_regs is also 103. If the register number is supposed
   to be an index (as I understand it), this would indicate an
   off-by-one error somewhere.

If you have some pointers on where to look / what to check out for
fixing this, I'll happily try to work on a patch. But I suppose that
somebody more experienced with this could probably fix this much faster
than I can.

Best regards,
Florian


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

end of thread, other threads:[~2026-03-01  0:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27  8:28 ppc-linux-user GDB stub broken Florian Hofhammer
2026-02-27  9:58 ` Philippe Mathieu-Daudé
2026-02-27 13:09   ` Philippe Mathieu-Daudé
2026-02-27 15:01     ` Alex Bennée
2026-02-27 21:40     ` Philippe Mathieu-Daudé
2026-02-27 21:43       ` Pierrick Bouvier
2026-02-27 21:47         ` Pierrick Bouvier
2026-02-27 17:21   ` Pierrick Bouvier
2026-02-27 21:24     ` Pierrick Bouvier
2026-02-28 17:53       ` Alex Bennée
2026-03-01  0:40         ` Pierrick Bouvier

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.