Add target_ops argument to to_terminal_ours
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:30:49 +0000 (21:30 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:45:39 +0000 (07:45 -0700)
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.

gdb/ChangeLog
gdb/go32-nat.c
gdb/inferior.h
gdb/inflow.c
gdb/linux-nat.c
gdb/remote.c
gdb/target.c
gdb/target.h

index 175f9f4..f7a5d30 100644 (file)
@@ -1,3 +1,16 @@
+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>
 
index 8f911e2..4e0b474 100644 (file)
@@ -903,7 +903,7 @@ go32_terminal_inferior (struct target_ops *self)
 }
 
 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.  */
index f298403..c577fb4 100644 (file)
@@ -127,7 +127,7 @@ extern void generic_mourn_inferior (void);
 
 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,
index 8d9a7f3..087cc60 100644 (file)
@@ -363,7 +363,7 @@ terminal_ours_for_output (struct target_ops *self)
    so they can be restored properly later.  */
 
 void
-terminal_ours (void)
+terminal_ours (struct target_ops *self)
 {
   terminal_ours_1 (0);
 }
index cd2798a..24cb1b9 100644 (file)
@@ -4606,19 +4606,19 @@ linux_nat_terminal_inferior (struct target_ops *self)
 /* 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;
index 456cd09..f6163a9 100644 (file)
@@ -220,7 +220,7 @@ static int peek_stop_reply (ptid_t ptid);
 
 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);
 
@@ -3000,7 +3000,7 @@ remote_close (struct target_ops *self)
 
   /* 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;
@@ -5148,7 +5148,7 @@ remote_terminal_inferior (struct target_ops *self)
 }
 
 static void
-remote_terminal_ours (void)
+remote_terminal_ours (struct target_ops *self)
 {
   if (!target_async_permitted)
     /* Nothing to do.  */
index 1f56a0a..ddb7c63 100644 (file)
@@ -140,7 +140,7 @@ static void debug_to_terminal_ours_for_output (struct target_ops *self);
 
 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);
 
@@ -778,7 +778,7 @@ update_current_target (void)
            (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))
@@ -4823,9 +4823,9 @@ debug_to_terminal_ours_for_output (struct target_ops *self)
 }
 
 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");
 }
index ffe4919..e835029 100644 (file)
@@ -490,7 +490,7 @@ struct target_ops
     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 *);
@@ -1245,7 +1245,7 @@ extern void target_terminal_inferior (void);
    so they can be restored properly later.  */
 
 #define target_terminal_ours() \
-     (*current_target.to_terminal_ours) ()
+     (*current_target.to_terminal_ours) (&current_target)
 
 /* Save our terminal settings.
    This is called from TUI after entering or leaving the curses