+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_rcmd>: Add argument.
+       (target_rcmd): Add argument.
+       * target.c (debug_to_rcmd): Add argument.
+       (update_current_target, do_monitor_command): Update.
+       * remote.c (remote_rcmd): Add 'self' argument.
+       * monitor.c (monitor_rcmd): Add 'self' argument.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * windows-nat.c (windows_stop): Add 'self' argument.
 
    ourseleves here cause of a nasty echo.  */
 
 static void
-monitor_rcmd (char *command,
+monitor_rcmd (struct target_ops *self, char *command,
              struct ui_file *outbuf)
 {
   char *p;
 
 }
 
 static void
-remote_rcmd (char *command,
+remote_rcmd (struct target_ops *self, char *command,
             struct ui_file *outbuf)
 {
   struct remote_state *rs = get_remote_state ();
 
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
   de_fault (to_rcmd,
-           (void (*) (char *, struct ui_file *))
+           (void (*) (struct target_ops *, char *, struct ui_file *))
            tcomplain);
   de_fault (to_pid_to_exec_file,
            (char *(*) (int))
 }
 
 static void
-debug_to_rcmd (char *command,
+debug_to_rcmd (struct target_ops *self, char *command,
               struct ui_file *outbuf)
 {
-  debug_target.to_rcmd (command, outbuf);
+  debug_target.to_rcmd (&debug_target, command, outbuf);
   fprintf_unfiltered (gdb_stdlog, "target_rcmd (%s, ...)\n", command);
 }
 
                 int from_tty)
 {
   if ((current_target.to_rcmd
-       == (void (*) (char *, struct ui_file *)) tcomplain)
+       == (void (*) (struct target_ops *, char *, struct ui_file *)) tcomplain)
       || (current_target.to_rcmd == debug_to_rcmd
          && (debug_target.to_rcmd
-             == (void (*) (char *, struct ui_file *)) tcomplain)))
+             == (void (*) (struct target_ops *,
+                           char *, struct ui_file *)) tcomplain)))
     error (_("\"monitor\" command not supported by this target."));
   target_rcmd (cmd, gdb_stdtarg);
 }
 
     char *(*to_extra_thread_info) (struct target_ops *, struct thread_info *);
     char *(*to_thread_name) (struct target_ops *, struct thread_info *);
     void (*to_stop) (struct target_ops *, ptid_t);
-    void (*to_rcmd) (char *command, struct ui_file *output);
+    void (*to_rcmd) (struct target_ops *,
+                    char *command, struct ui_file *output);
     char *(*to_pid_to_exec_file) (int pid);
     void (*to_log_command) (const char *);
     struct target_section_table *(*to_get_section_table) (struct target_ops *);
    placed in OUTBUF.  */
 
 #define target_rcmd(command, outbuf) \
-     (*current_target.to_rcmd) (command, outbuf)
+     (*current_target.to_rcmd) (¤t_target, command, outbuf)
 
 
 /* Does the target include all of memory, or only part of it?  This