diff mbox series

[01/22] semihosting: add guest_error logging for failed opens

Message ID 20250109170619.2271193-2-alex.bennee@linaro.org (mailing list archive)
State New
Headers show
Series maintainer updates for jan '25 (semihosting, gdb, plugins) | expand

Commit Message

Alex Bennée Jan. 9, 2025, 5:05 p.m. UTC
This usually indicates the semihosting call was expecting to find
something but didn't.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 semihosting/syscalls.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Pierrick Bouvier Jan. 9, 2025, 6:48 p.m. UTC | #1
On 1/9/25 09:05, Alex Bennée wrote:
> This usually indicates the semihosting call was expecting to find
> something but didn't.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   semihosting/syscalls.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c
> index c40348f996..f6451d9bb0 100644
> --- a/semihosting/syscalls.c
> +++ b/semihosting/syscalls.c
> @@ -7,6 +7,7 @@
>    */
>   
>   #include "qemu/osdep.h"
> +#include "qemu/log.h"
>   #include "cpu.h"
>   #include "gdbstub/syscalls.h"
>   #include "semihosting/guestfd.h"
> @@ -287,6 +288,7 @@ static void host_open(CPUState *cs, gdb_syscall_complete_cb complete,
>   
>       ret = open(p, host_flags, mode);
>       if (ret < 0) {
> +        qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to open %s\n", __func__, p);
>           complete(cs, -1, errno);
>       } else {
>           int guestfd = alloc_guestfd();

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c
index c40348f996..f6451d9bb0 100644
--- a/semihosting/syscalls.c
+++ b/semihosting/syscalls.c
@@ -7,6 +7,7 @@ 
  */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "gdbstub/syscalls.h"
 #include "semihosting/guestfd.h"
@@ -287,6 +288,7 @@  static void host_open(CPUState *cs, gdb_syscall_complete_cb complete,
 
     ret = open(p, host_flags, mode);
     if (ret < 0) {
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to open %s\n", __func__, p);
         complete(cs, -1, errno);
     } else {
         int guestfd = alloc_guestfd();