+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_terminal_ours>: Add argument.
+       (target_terminal_ours): Add argument.
+       * target.c (debug_to_terminal_ours): Add argument.
+       (update_current_target): Update.
+       * remote.c (remote_terminal_ours): Add 'self' argument.
+       (remote_close): Update.
+       * linux-nat.c (linux_nat_terminal_ours): Add 'self' argument.
+       * inflow.c (terminal_ours): Add 'self' argument.
+       * inferior.h (terminal_ours): Add 'self' argument.
+       * go32-nat.c (go32_terminal_ours): Add 'self' argument.
+
 2014-02-19  Pedro Alves  <palves@redhat.com>
            Tom Tromey  <tromey@redhat.com>
 
 
 }
 
 static void
-go32_terminal_ours (void)
+go32_terminal_ours (struct target_ops *self)
 {
   /* Switch to cooked mode on the gdb terminal and save the inferior
      terminal mode to be restored when it is resumed.  */
 
 
 extern void terminal_save_ours (void);
 
-extern void terminal_ours (void);
+extern void terminal_ours (struct target_ops *self);
 
 extern CORE_ADDR unsigned_pointer_to_address (struct gdbarch *gdbarch,
                                              struct type *type,
 
    so they can be restored properly later.  */
 
 void
-terminal_ours (void)
+terminal_ours (struct target_ops *self)
 {
   terminal_ours_1 (0);
 }
 
 /* target_terminal_ours implementation.  */
 
 static void
-linux_nat_terminal_ours (void)
+linux_nat_terminal_ours (struct target_ops *self)
 {
   if (!target_is_async_p ())
     {
       /* Async mode is disabled.  */
-      terminal_ours ();
+      terminal_ours (self);
       return;
     }
 
   /* GDB should never give the terminal to the inferior if the
      inferior is running in the background (run&, continue&, etc.),
      but claiming it sure should.  */
-  terminal_ours ();
+  terminal_ours (self);
 
   if (async_terminal_is_ours)
     return;
 
 
 static void remote_async_inferior_event_handler (gdb_client_data);
 
-static void remote_terminal_ours (void);
+static void remote_terminal_ours (struct target_ops *self);
 
 static int remote_read_description_p (struct target_ops *target);
 
 
   /* Make sure we leave stdin registered in the event loop, and we
      don't leave the async SIGINT signal handler installed.  */
-  remote_terminal_ours ();
+  remote_terminal_ours (self);
 
   serial_close (rs->remote_desc);
   rs->remote_desc = NULL;
 }
 
 static void
-remote_terminal_ours (void)
+remote_terminal_ours (struct target_ops *self)
 {
   if (!target_async_permitted)
     /* Nothing to do.  */
 
 
 static void debug_to_terminal_save_ours (void);
 
-static void debug_to_terminal_ours (void);
+static void debug_to_terminal_ours (struct target_ops *self);
 
 static void debug_to_load (char *, int);
 
            (void (*) (struct target_ops *))
            target_ignore);
   de_fault (to_terminal_ours,
-           (void (*) (void))
+           (void (*) (struct target_ops *))
            target_ignore);
   de_fault (to_terminal_save_ours,
            (void (*) (void))
 }
 
 static void
-debug_to_terminal_ours (void)
+debug_to_terminal_ours (struct target_ops *self)
 {
-  debug_target.to_terminal_ours ();
+  debug_target.to_terminal_ours (&debug_target);
 
   fprintf_unfiltered (gdb_stdlog, "target_terminal_ours ()\n");
 }
 
     void (*to_terminal_init) (struct target_ops *);
     void (*to_terminal_inferior) (struct target_ops *);
     void (*to_terminal_ours_for_output) (struct target_ops *);
-    void (*to_terminal_ours) (void);
+    void (*to_terminal_ours) (struct target_ops *);
     void (*to_terminal_save_ours) (void);
     void (*to_terminal_info) (const char *, int);
     void (*to_kill) (struct target_ops *);
    so they can be restored properly later.  */
 
 #define target_terminal_ours() \
-     (*current_target.to_terminal_ours) ()
+     (*current_target.to_terminal_ours) (¤t_target)
 
 /* Save our terminal settings.
    This is called from TUI after entering or leaving the curses