[RFC PATCH RESEND 08/42] accel/split: Implement gdbstub_supported_sstep_flags()

Philippe Mathieu-Daudé posted 42 patches 4 months, 3 weeks ago
[RFC PATCH RESEND 08/42] accel/split: Implement gdbstub_supported_sstep_flags()
Posted by Philippe Mathieu-Daudé 4 months, 3 weeks ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/split/split-all.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/accel/split/split-all.c b/accel/split/split-all.c
index cb910300931..413954af96c 100644
--- a/accel/split/split-all.c
+++ b/accel/split/split-all.c
@@ -77,7 +77,19 @@ static bool split_supports_guest_debug(AccelState *as)
 
 static int split_gdbstub_supported_sstep_flags(AccelState *as)
 {
-    g_assert_not_reached();
+    SplitAccelState *sas = SPLIT_ACCEL(as);
+    AccelClass *hwc = ACCEL_GET_CLASS(sas->hw);
+    AccelClass *swc = ACCEL_GET_CLASS(sas->sw);
+    int flags = -1;
+
+    if (hwc->gdbstub_supported_sstep_flags) {
+        flags &= hwc->gdbstub_supported_sstep_flags(sas->hw);
+    }
+    if (swc->gdbstub_supported_sstep_flags) {
+        flags &= swc->gdbstub_supported_sstep_flags(sas->sw);
+    }
+
+    return flags;
 }
 
 static void split_get_stats(AccelState *as, GString *buf)
-- 
2.49.0


Re: [RFC PATCH RESEND 08/42] accel/split: Implement gdbstub_supported_sstep_flags()
Posted by Richard Henderson 4 months, 3 weeks ago
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/split/split-all.c | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/accel/split/split-all.c b/accel/split/split-all.c
> index cb910300931..413954af96c 100644
> --- a/accel/split/split-all.c
> +++ b/accel/split/split-all.c
> @@ -77,7 +77,19 @@ static bool split_supports_guest_debug(AccelState *as)
>   
>   static int split_gdbstub_supported_sstep_flags(AccelState *as)
>   {
> -    g_assert_not_reached();
> +    SplitAccelState *sas = SPLIT_ACCEL(as);
> +    AccelClass *hwc = ACCEL_GET_CLASS(sas->hw);
> +    AccelClass *swc = ACCEL_GET_CLASS(sas->sw);
> +    int flags = -1;

This only works if one of hw/sw implements the hook.


r~

> +
> +    if (hwc->gdbstub_supported_sstep_flags) {
> +        flags &= hwc->gdbstub_supported_sstep_flags(sas->hw);
> +    }
> +    if (swc->gdbstub_supported_sstep_flags) {
> +        flags &= swc->gdbstub_supported_sstep_flags(sas->sw);
> +    }
> +
> +    return flags;
>   }
>   
>   static void split_get_stats(AccelState *as, GString *buf)