gdbstub: abstract target specific details from gdb_put_packet_binary

We unfortunately handle the checking of packet acknowledgement
differently for user and softmmu modes. Abstract the user mode stuff
behind gdb_got_immediate_ack with a stub for softmmu.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230302190846.2593720-14-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-14-richard.henderson@linaro.org>
This commit is contained in:
Alex Bennée
2023-03-02 18:57:49 -08:00
parent ccd4c7c24a
commit a7e0f9bd2a
4 changed files with 44 additions and 8 deletions

View File

@@ -239,15 +239,9 @@ int gdb_put_packet_binary(const char *buf, int len, bool dump)
gdb_put_buffer(gdbserver_state.last_packet->data,
gdbserver_state.last_packet->len);
#ifdef CONFIG_USER_ONLY
i = gdb_get_char();
if (i < 0)
return -1;
if (i == '+')
if (gdb_got_immediate_ack()) {
break;
#else
break;
#endif
}
}
return 0;
}