gdb:
[deliverable/binutils-gdb.git] / gdb / gdbserver / server.c
index e3d1f7cc371d3c2ac60c89c7998093c9cbe8d0e9..0de3f52f033f877896c97598583bf619b4ddc38d 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "agent.h"
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
@@ -529,6 +530,30 @@ handle_general_set (char *own_buf)
       && handle_tracepoint_general_set (own_buf))
     return;
 
+  if (strncmp ("QAgent:", own_buf, strlen ("QAgent:")) == 0)
+    {
+      char *mode = own_buf + strlen ("QAgent:");
+      int req = 0;
+
+      if (strcmp (mode, "0") == 0)
+       req = 0;
+      else if (strcmp (mode, "1") == 0)
+       req = 1;
+      else
+       {
+         /* We don't know what this value is, so complain to GDB.  */
+         sprintf (own_buf, "E.Unknown QAgent value");
+         return;
+       }
+
+      /* Update the flag.  */
+      use_agent = req;
+      if (remote_debug)
+       fprintf (stderr, "[%s agent]\n", req ? "Enable" : "Disable");
+      write_ok (own_buf);
+      return;
+    }
+
   /* Otherwise we didn't know what packet it was.  Say we didn't
      understand it.  */
   own_buf[0] = 0;
@@ -1624,6 +1649,9 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
       /* Support target-side breakpoint conditions.  */
       strcat (own_buf, ";ConditionalBreakpoints+");
 
+      if (target_supports_agent ())
+       strcat (own_buf, ";QAgent+");
+
       return;
     }
 
This page took 0.023715 seconds and 4 git commands to generate.