Skip to content

Commit

Permalink
softmmu/watchpoint: Add missing 'qemu/error-report.h' include
Browse files Browse the repository at this point in the history
cpu_watchpoint_insert() calls error_report() which is declared
in "qemu/error-report.h". When moving this code in commit 2609ec2
("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>
Message-Id: <20230328173117.15226-3-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
philmd authored and rth7680 committed Mar 28, 2023
1 parent 6eece7f commit a085860
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions softmmu/watchpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a085860

Please sign in to comment.