Get st-util ack'ing the monitor request. Responds to
authorFabien Le Mentec <texane@gmail.com>
Wed, 1 Feb 2012 22:05:46 +0000 (16:05 -0600)
committerFabien Le Mentec <texane@gmail.com>
Wed, 1 Feb 2012 22:05:46 +0000 (16:05 -0600)
    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

index 89f862db00c14686e39ed665806ab64e8c089c33..94784fcdb896d7c88fdcc6894d7f52366af73ee2 100644 (file)
@@ -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)