* regcache.h (struct thread_info): Forward declare.
[deliverable/binutils-gdb.git] / gdb / gdbserver / remote-utils.c
index 76953aed42b19bd059316681774b7469bd5704da..7cd1e2d7cf23c750904a8f81a4413a33d43ab473 100644 (file)
@@ -1053,7 +1053,7 @@ convert_ascii_to_int (char *from, unsigned char *to, int n)
 }
 
 static char *
-outreg (int regno, char *buf)
+outreg (struct regcache *regcache, int regno, char *buf)
 {
   if ((regno >> 12) != 0)
     *buf++ = tohex ((regno >> 12) & 0xf);
@@ -1062,7 +1062,7 @@ outreg (int regno, char *buf)
   *buf++ = tohex ((regno >> 4) & 0xf);
   *buf++ = tohex (regno & 0xf);
   *buf++ = ':';
-  collect_register_as_string (regno, buf);
+  collect_register_as_string (regcache, regno, buf);
   buf += 2 * register_size (regno);
   *buf++ = ';';
 
@@ -1116,6 +1116,7 @@ prepare_resume_reply (char *buf, ptid_t ptid,
       {
        struct thread_info *saved_inferior;
        const char **regp;
+       struct regcache *regcache;
 
        sprintf (buf, "T%02x", status->value.sig);
        buf += strlen (buf);
@@ -1126,6 +1127,8 @@ prepare_resume_reply (char *buf, ptid_t ptid,
 
        current_inferior = find_thread_ptid (ptid);
 
+       regcache = get_thread_regcache (current_inferior, 1);
+
        if (the_target->stopped_by_watchpoint != NULL
            && (*the_target->stopped_by_watchpoint) ())
          {
@@ -1148,7 +1151,7 @@ prepare_resume_reply (char *buf, ptid_t ptid,
 
        while (*regp)
          {
-           buf = outreg (find_regno (*regp), buf);
+           buf = outreg (regcache, find_regno (*regp), buf);
            regp ++;
          }
        *buf = '\0';
This page took 0.024362 seconds and 4 git commands to generate.