diff mbox series

[PATCH-for-8.0,v2,2/3] softmmu/watchpoint: Add missing 'qemu/error-report.h' include

Message ID 20230328173117.15226-3-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series softmmu: Restore use of CPU watchpoint for non-TCG accelerators | expand

Commit Message

Philippe Mathieu-Daudé March 28, 2023, 5:31 p.m. UTC
cpu_watchpoint_insert() calls error_report() which is declared
in "qemu/error-report.h". When moving this code in commit 2609ec2868
("softmmu: Extract watchpoint API from physmem.c") we neglected to
include this header. This works so far because it is indirectly
included by TCG headers -> "qemu/plugin.h" -> "qemu/error-report.h".

Currently cpu_watchpoint_insert() is only built with the TCG
accelerator. When building it with other ones (or without TCG)
we get:

  softmmu/watchpoint.c:38:9: error: implicit declaration of function 'error_report' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        error_report("tried to set invalid watchpoint at %"
        ^

Include "qemu/error-report.h" in order to fix this for non-TCG
builds.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 softmmu/watchpoint.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Fabiano Rosas March 29, 2023, 1:58 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> cpu_watchpoint_insert() calls error_report() which is declared
> in "qemu/error-report.h". When moving this code in commit 2609ec2868
> ("softmmu: Extract watchpoint API from physmem.c") we neglected to
> include this header. This works so far because it is indirectly
> included by TCG headers -> "qemu/plugin.h" -> "qemu/error-report.h".
>
> Currently cpu_watchpoint_insert() is only built with the TCG
> accelerator. When building it with other ones (or without TCG)
> we get:
>
>   softmmu/watchpoint.c:38:9: error: implicit declaration of function 'error_report' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         error_report("tried to set invalid watchpoint at %"
>         ^
>
> Include "qemu/error-report.h" in order to fix this for non-TCG
> builds.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Fabiano Rosas <farosas@suse.de>
diff mbox series

Patch

diff --git a/softmmu/watchpoint.c b/softmmu/watchpoint.c
index ad58736787..9d6ae68499 100644
--- a/softmmu/watchpoint.c
+++ b/softmmu/watchpoint.c
@@ -19,6 +19,7 @@ 
 
 #include "qemu/osdep.h"
 #include "qemu/main-loop.h"
+#include "qemu/error-report.h"
 #include "exec/exec-all.h"
 #include "exec/translate-all.h"
 #include "sysemu/tcg.h"