From 18d6fe4893d92b67f1690674a6e7482eef18a31f Mon Sep 17 00:00:00 2001 From: Fabien Le Mentec Date: Wed, 1 Feb 2012 16:05:46 -0600 Subject: [PATCH] Get st-util ack'ing the monitor request. Responds to monitor reset -- reset the core monitor resume -- get the core running but don't stop gdb executing commands monitor halt -- halt the core --- gdbserver/gdb-server.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gdbserver/gdb-server.c b/gdbserver/gdb-server.c index 89f862d..94784fc 100644 --- a/gdbserver/gdb-server.c +++ b/gdbserver/gdb-server.c @@ -669,6 +669,49 @@ int serve(stlink_t *sl, int port) { strncpy(&reply[1], data, length); } } + } else if(!strncmp(queryName, "Rcmd,",4)) { + // Rcmd uses the wrong separator + char *separator = strstr(packet, ","), *params = ""; + if(separator == NULL) { + separator = packet + strlen(packet); + } else { + params = separator + 1; + } + + + if (!strncmp(params,"7265",4)) {// resume +#ifdef DEBUG + printf("Rcmd: resume\n"); +#endif + stlink_run(sl); + + reply = strdup("OK"); + } else if (!strncmp(params,"6861",4)) { //half + reply = strdup("OK"); + + stlink_force_debug(sl); + +#ifdef DEBUG + printf("Rcmd: halt\n"); +#endif + } else if (!strncmp(params,"7265",4)) { //reset + reply = strdup("OK"); + + stlink_force_debug(sl); + stlink_reset(sl); + init_code_breakpoints(sl); + init_data_watchpoints(sl); + +#ifdef DEBUG + printf("Rcmd: reset\n"); +#endif + } else { +#ifdef DEBUG + printf("Rcmd: %s\n", params); +#endif + + } + } if(reply == NULL) -- 2.30.2