Skip to content

gdbstub: Export helper to use GDB errno values

Yodel Eldar via qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 3 repliesIn review

Changes in v2 from the cover letter

- Split into multiple commits
- Use existing mapping function (host_to_gdb_errno) via exportation

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3include/gdbstub/syscalls: Add GDB_{EIO, ENOSYS} errno valuesinclude/gdbstub/syscalls.h+2 -01 reply
2/3gdbstub: Export host_to_gdb_errno File-I/O helper functiongdbstub/syscalls.c include/gdbstub/syscalls.h target/m68k/m68k-semi.c+45 -291 reply
3/3gdbstub/user-target: Convert host errno to GDB File-I/O errnogdbstub/user-target.c+9 -40 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchRichard Henderson
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] gdbstub: Export helper to use GDB errno values

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/[email protected]/

[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(-)
Signature · 1 line
2.51.1.dirty