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.

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

Patch 2 exports 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 passes the host errnos to the newly global mapping function
before emitting the result in F reply packets. This is the only patch
that still needs review, although it is somewhat similar to the v1
version that Alex reviewed.

I'm resending instead of just pinging, because there were DKIM-signing
issues last time, and that led to From-munging of the emails which could
be problematic for tooling. I believe that problem's resolved now.

Besides the DKIM-signing issue, the bashism in the commit title of Patch
1 was getting mangled with a spurious space presumably by Mailman, so
I've also changed it, despite my partiality for bashisms as that also
would've caused DKIM verification failure and possible munging.

Thanks to Richard for the reviews in v2 and for having written that nice
helper function exported and used in this series.

Thanks to Alex for the review of v1 that is now Patch 3. I wanted to
collect your R-b, but the patch underwent nontrivial change in v2, so I
left it out in case you had objections to those changes.

Changes in v3:
No functional changes
- Rebase on mainline (no conflicts)
- Collect R-b's (Thanks, Richard)
- Minor rewording of commit messages

Changes in v2:
- New patch adding two errno values
- New patch exporting helper function that maps errno values

Link to v2:
https://lore.kernel.org/qemu-devel/[email protected]/
Link to v1:
https://lore.kernel.org/qemu-devel/[email protected]/

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

Thanks,
Yodel

Yodel Eldar (3):
  include/gdbstub/syscalls: Add EIO and ENOSYS GDB File-I/O 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.52.0


Reply via email to