[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 19/53] gdbstub: Convert GDB error numbers to host error nu
From: |
Luc Michel |
Subject: |
Re: [PATCH v4 19/53] gdbstub: Convert GDB error numbers to host error numbers |
Date: |
Wed, 22 Jun 2022 09:53:11 +0200 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On 13:45 Tue 07 Jun , Richard Henderson wrote:
> Provide the callback with consistent state -- always use
> host error numbers. The individual callback can then
> decide if the errno requires conversion for the guest.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <lmichel@kalray.eu>
> ---
> gdbstub.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index a3ff8702ce..ecc9d9cd6f 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1878,6 +1878,37 @@ static void handle_file_io(GArray *params, void
> *user_ctx)
> } else {
> err = 0;
> }
> +
> + /* Convert GDB error numbers back to host error numbers. */
> +#define E(X) case GDB_E##X: err = E##X; break
> + switch (err) {
> + case 0:
> + break;
> + E(PERM);
> + E(NOENT);
> + E(INTR);
> + E(BADF);
> + E(ACCES);
> + E(FAULT);
> + E(BUSY);
> + E(EXIST);
> + E(NODEV);
> + E(NOTDIR);
> + E(ISDIR);
> + E(INVAL);
> + E(NFILE);
> + E(MFILE);
> + E(FBIG);
> + E(NOSPC);
> + E(SPIPE);
> + E(ROFS);
> + E(NAMETOOLONG);
> + default:
> + err = EINVAL;
> + break;
> + }
> +#undef E
> +
> gdbserver_state.current_syscall_cb(gdbserver_state.c_cpu, ret, err);
> gdbserver_state.current_syscall_cb = NULL;
> }
> --
> 2.34.1
>
>
>
>
> To declare a filtering error, please use the following link :
> https://www.security-mail.net/reporter.php?mid=12eb3.629fd0dd.8c7c2.0&r=lmichel%40kalrayinc.com&s=qemu-devel-bounces%2Blmichel%3Dkalrayinc.com%40nongnu.org&o=%5BPATCH+v4+19%2F53%5D+gdbstub%3A+Convert+GDB+error+numbers+to+host+error+numbers&verdict=C&c=cdb84b0ad101f626e700d163f173cb52e6d969f7
>
--
- [PATCH v4 31/53] semihosting: Bound length for semihost_sys_{read, write}, (continued)
- [PATCH v4 31/53] semihosting: Bound length for semihost_sys_{read, write}, Richard Henderson, 2022/06/07
- [PATCH v4 35/53] semihosting: Split out semihost_sys_remove, Richard Henderson, 2022/06/07
- [PATCH v4 37/53] semihosting: Split out semihost_sys_system, Richard Henderson, 2022/06/07
- [PATCH v4 38/53] semihosting: Create semihost_sys_{stat,fstat}, Richard Henderson, 2022/06/07
- [PATCH v4 19/53] gdbstub: Convert GDB error numbers to host error numbers, Richard Henderson, 2022/06/07
- Re: [PATCH v4 19/53] gdbstub: Convert GDB error numbers to host error numbers,
Luc Michel <=
- [PATCH v4 20/53] semihosting: Use struct gdb_stat in common_semi_flen_cb, Richard Henderson, 2022/06/07
- [PATCH v4 21/53] semihosting: Split is_64bit_semihosting per target, Richard Henderson, 2022/06/07
- [PATCH v4 22/53] semihosting: Split common_semi_flen_buf per target, Richard Henderson, 2022/06/07
- [PATCH v4 24/53] semihosting: Split out common-semi-target.h, Richard Henderson, 2022/06/07
- [PATCH v4 28/53] semihosting: Split out semihost_sys_close, Richard Henderson, 2022/06/07
- [PATCH v4 26/53] semihosting: Move GET_ARG/SET_ARG earlier in the file, Richard Henderson, 2022/06/07