]> Git Repo - binutils.git/blobdiff - gdb/gdbserver/remote-utils.c
2005-05-12 Orjan Friberg <[email protected]>
[binutils.git] / gdb / gdbserver / remote-utils.c
index 7cc9150b5355f85d480da7292c8207f9d7589833..8082090fef2e38012795371384e25ea573ac22b2 100644 (file)
@@ -639,6 +639,28 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
   if (status == 'T')
     {
       const char **regp = gdbserver_expedite_regs;
+
+      if (the_target->stopped_by_watchpoint != NULL
+         && (*the_target->stopped_by_watchpoint) ())
+       {
+         CORE_ADDR addr;
+         int i;
+
+         strncpy (buf, "watch:", 6);
+         buf += 6;
+
+         addr = (*the_target->stopped_data_address) ();
+
+         /* Convert each byte of the address into two hexadecimal chars.
+            Note that we take sizeof (void *) instead of sizeof (addr);
+            this is to avoid sending a 64-bit address to a 32-bit GDB.  */
+         for (i = sizeof (void *) * 2; i > 0; i--)
+           {
+             *buf++ = tohex ((addr >> (i - 1) * 4) & 0xf);
+           }
+         *buf++ = ';';
+       }
+
       while (*regp)
        {
          buf = outreg (find_regno (*regp), buf);
This page took 0.025427 seconds and 4 git commands to generate.