@@ -152,7 +152,7 @@ int gdb_continue_partial(char *newstates);
void gdb_put_buffer(const uint8_t *buf, int len);
/*
- * Command handlers - either softmmu or user only
+ * Command handlers - either specialised or softmmu or user only
*/
void gdb_init_gdbserver_state(void);
@@ -181,6 +181,8 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx); /* softmmu */
void gdb_handle_query_offsets(GArray *params, void *user_ctx); /* user */
void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx); /*user */
+void gdb_handle_query_attached(GArray *params, void *user_ctx); /* both */
+
/*
* Break/Watch point support - there is an implementation for softmmu
* and user mode.
@@ -46,12 +46,6 @@
#include "internals.h"
-#ifdef CONFIG_USER_ONLY
-#define GDB_ATTACHED "0"
-#else
-#define GDB_ATTACHED "1"
-#endif
-
#ifndef CONFIG_USER_ONLY
static int phy_memory_mode;
#endif
@@ -1672,11 +1666,6 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx)
gdbserver_state.str_buf->len, true);
}
-static void handle_query_attached(GArray *params, void *user_ctx)
-{
- gdb_put_packet(GDB_ATTACHED);
-}
-
static void handle_query_qemu_supported(GArray *params, void *user_ctx)
{
g_string_printf(gdbserver_state.str_buf, "sstepbits;sstep");
@@ -1786,12 +1775,12 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = {
},
#endif
{
- .handler = handle_query_attached,
+ .handler = gdb_handle_query_attached,
.cmd = "Attached:",
.cmd_startswith = 1
},
{
- .handler = handle_query_attached,
+ .handler = gdb_handle_query_attached,
.cmd = "Attached",
},
{
@@ -439,6 +439,11 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx)
* Execution state helpers
*/
+void gdb_handle_query_attached(GArray *params, void *user_ctx)
+{
+ gdb_put_packet("1");
+}
+
void gdb_continue(void)
{
if (!runstate_needs_reset()) {
@@ -340,6 +340,11 @@ void gdbserver_fork(CPUState *cpu)
* Execution state helpers
*/
+void gdb_handle_query_attached(GArray *params, void *user_ctx)
+{
+ gdb_put_packet("0");
+}
+
void gdb_continue(void)
{
gdbserver_user_state.running_state = 1;