Permalink
Browse files

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
  • Loading branch information...
texane committed Feb 1, 2012
1 parent a12ffa5 commit 18d6fe4893d92b67f1690674a6e7482eef18a31f
Showing with 43 additions and 0 deletions.
  1. +43 −0 gdbserver/gdb-server.c
View
@@ -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)

0 comments on commit 18d6fe4

Please sign in to comment.