diff mbox series

[v3,04/12] linux-user: Log failing executable in EXCP_DUMP()

Message ID 20220918194555.83535-5-deller@gmx.de (mailing list archive)
State New, archived
Headers show
Series linux-user: Add more syscalls, enhance tracing & logging enhancements | expand

Commit Message

Helge Deller Sept. 18, 2022, 7:45 p.m. UTC
Enhance the EXCP_DUMP() macro to print out the failing program too.
During debugging it's sometimes hard to track down the actual failing
program if you are e.g. building a whole debian package.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/cpu_loop-common.h | 2 ++
 1 file changed, 2 insertions(+)

--
2.37.3

Comments

Philippe Mathieu-Daudé Sept. 18, 2022, 8:37 p.m. UTC | #1
On 18/9/22 21:45, Helge Deller wrote:
> Enhance the EXCP_DUMP() macro to print out the failing program too.
> During debugging it's sometimes hard to track down the actual failing
> program if you are e.g. building a whole debian package.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/cpu_loop-common.h | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Laurent Vivier Sept. 25, 2022, 3:26 p.m. UTC | #2
Le 18/09/2022 à 21:45, Helge Deller a écrit :
> Enhance the EXCP_DUMP() macro to print out the failing program too.
> During debugging it's sometimes hard to track down the actual failing
> program if you are e.g. building a whole debian package.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/cpu_loop-common.h | 2 ++
>   1 file changed, 2 insertions(+)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/linux-user/cpu_loop-common.h b/linux-user/cpu_loop-common.h
index dc0042e4de..36ff5b14f2 100644
--- a/linux-user/cpu_loop-common.h
+++ b/linux-user/cpu_loop-common.h
@@ -27,9 +27,11 @@ 
 do {                                                                    \
     CPUState *cs = env_cpu(env);                                        \
     fprintf(stderr, fmt , ## __VA_ARGS__);                              \
+    fprintf(stderr, "Failing executable: %s\n", exec_path);             \
     cpu_dump_state(cs, stderr, 0);                                      \
     if (qemu_log_separate()) {                                          \
         qemu_log(fmt, ## __VA_ARGS__);                                  \
+        qemu_log("Failing executable: %s\n", exec_path);                \
         log_cpu_state(cs, 0);                                           \
     }                                                                   \
 } while (0)