target/arm/gdbstub: Only advertise M-profile features if TCG available
commit46e3b237c52e0c48bfd81bce020b51fbe300b23a
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 22 Mar 2023 14:29:02 +0000 (22 15:29 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Mar 2023 09:53:40 +0000 (28 10:53 +0100)
treed7d38005b95199dcc4d5ae3bab94285b997058a8
parente3debd5e7d0ce031356024878a0a18b9d109354a
target/arm/gdbstub: Only advertise M-profile features if TCG available

Cortex-M profile is only emulable from TCG accelerator. Restrict
the GDBstub features to its availability in order to avoid a link
error when TCG is not enabled:

  Undefined symbols for architecture arm64:
    "_arm_v7m_get_sp_ptr", referenced from:
        _m_sysreg_get in target_arm_gdbstub.c.o
    "_arm_v7m_mrs_control", referenced from:
        _arm_gdb_get_m_systemreg in target_arm_gdbstub.c.o
  ld: symbol(s) not found for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes: 7d8b28b8b5 ("target/arm: Implement gdbstub m-profile systemreg and secext")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20230322142902.69511-3-philmd@linaro.org
[PMM: add #include since I cherry-picked this patch from the series]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/gdbstub.c