qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] gdbstub: Export helper to use GDB errno values
@ 2025-10-17 21:11 Yodel Eldar via
  2025-10-17 21:11 ` [PATCH v2 1/3] include/gdbstub/syscalls: Add GDB_{EIO, ENOSYS} " Yodel Eldar via
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Yodel Eldar via @ 2025-10-17 21:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yodel Eldar

Currently, F reply packets in gdbstub/user-target.c emit the host's
errno values [1], but to facilitate host<->target independence the GDB
File-I/O protocol defines its own set of supported errno values that
should be used in replies instead.

This series sees to that by:
Patch 2: Exporting a mapping helper function statically defined in
m68k-dependent code by declaring it in include/gdbstub/syscalls.h
with the GDB File-I/O errno values, and moving the definition to
gdbstub/syscalls.c.
Patch 3: Passing the host errnos to the newly global mapping function
before emitting the result in F reply packets. Please note that this
patch resolves the final task remaining in GitLab issue #2751.

Patch 1 adds two GDB File-I/O errno values that were previously
undocumented despite having support.

To Alex Bennée: Thanks for reviewing v1! I deliberately left out the
Reviewed-by git trailer, because the patch underwent nontrivial
changes, and I did not think I could include it in good faith. Your
comment about the existing File-I/O errno values led me to the helper
function in the target-dependent code.

Thanks!

Changes in v2:
- Split into multiple commits
- Use existing mapping function (host_to_gdb_errno) via exportation

Link to v1: https://lore.kernel.org/qemu-devel/20251015162520.15736-1-yodel.eldar@yodel.dev/

[1] https://gitlab.com/qemu-project/qemu/-/issues/2751

Yodel Eldar (3):
  include/gdbstub/syscalls: Add GDB_{EIO,ENOSYS} errno values
  gdbstub: Export host_to_gdb_errno File-I/O helper function
  gdbstub/user-target: Convert host errno to GDB File-I/O errno

 gdbstub/syscalls.c         | 36 ++++++++++++++++++++++++++++++++++++
 gdbstub/user-target.c      | 13 +++++++++----
 include/gdbstub/syscalls.h | 11 +++++++++++
 target/m68k/m68k-semi.c    | 29 -----------------------------
 4 files changed, 56 insertions(+), 33 deletions(-)

-- 
2.51.1.dirty



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

end of thread, other threads:[~2025-10-27  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 21:11 [PATCH v2 0/3] gdbstub: Export helper to use GDB errno values Yodel Eldar via
2025-10-17 21:11 ` [PATCH v2 1/3] include/gdbstub/syscalls: Add GDB_{EIO, ENOSYS} " Yodel Eldar via
2025-10-17 23:54   ` Richard Henderson
2025-10-17 21:11 ` [PATCH v2 2/3] gdbstub: Export host_to_gdb_errno File-I/O helper function Yodel Eldar via
2025-10-17 23:55   ` Richard Henderson
2025-10-17 21:11 ` [PATCH v2 3/3] gdbstub/user-target: Convert host errno to GDB File-I/O errno Yodel Eldar via
2025-10-27  8:03 ` [PATCH v2 0/3] gdbstub: Export helper to use GDB errno values Yodel Eldar via

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).