[PATCH v3 0/3] gdbstub: Export helper to use GDB errno values

Yodel Eldar posted 3 patches 3 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260116014612.226183-1-yodel.eldar@yodel.dev
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Laurent Vivier <laurent@vivier.eu>
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(-)
[PATCH v3 0/3] gdbstub: Export helper to use GDB errno values
Posted by Yodel Eldar 3 weeks, 1 day ago
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/20251017211149.163762-1-yodel.eldar@yodel.dev/
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

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
Re: [PATCH v3 0/3] gdbstub: Export helper to use GDB errno values
Posted by Alex Bennée 1 week, 2 days ago
Yodel Eldar <yodel.eldar@yodel.dev> writes:

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

Queued to gdbstub/next, thanks.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH v3 0/3] gdbstub: Export helper to use GDB errno values
Posted by Yodel Eldar 1 week, 2 days ago
Hi,

On 15/01/2026 19:46, Yodel Eldar wrote:
> 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/20251017211149.163762-1-yodel.eldar@yodel.dev/
> 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
> 
> 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(-)
> 

Ping?

Please note: series is fully reviewed.

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

Thanks,
Yodel
Re: [PATCH v3 0/3] gdbstub: Export helper to use GDB errno values
Posted by Philippe Mathieu-Daudé 2 weeks, 3 days ago
On 16/1/26 02:46, Yodel Eldar wrote:

> 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

Series fully reviewed.
Re: [PATCH v3 0/3] gdbstub: Export helper to use GDB errno values
Posted by Yodel Eldar 2 weeks, 2 days ago
Hi, Philippe

On 19/01/2026 23:51, Philippe Mathieu-Daudé wrote:
> On 16/1/26 02:46, Yodel Eldar wrote:
> 
>> 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
> 
> Series fully reviewed.
> 

Thanks for reviewing the series.

Yodel