From c42bf2866f330d7844917c40cf5886333fa3ea24 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:30:10 -0700 Subject: [PATCH] Add target_ops argument to to_terminal_init 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. (target_terminal_init): Add argument. * target.c (debug_to_terminal_init): Add argument. (update_current_target): Update. * inflow.c (terminal_init_inferior): Add 'self' argument. * inferior.h (terminal_init_inferior): Add 'self' argument. * go32-nat.c (go32_terminal_init): Add 'self' argument. * gnu-nat.c (gnu_terminal_init_inferior): Add 'self' argument. --- gdb/ChangeLog | 11 +++++++++++ gdb/gnu-nat.c | 2 +- gdb/go32-nat.c | 2 +- gdb/inferior.h | 2 +- gdb/inflow.c | 2 +- gdb/target.c | 8 ++++---- gdb/target.h | 4 ++-- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6dde680e763..93b0d51db09 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add argument. + (target_terminal_init): Add argument. + * target.c (debug_to_terminal_init): Add argument. + (update_current_target): Update. + * inflow.c (terminal_init_inferior): Add 'self' argument. + * inferior.h (terminal_init_inferior): Add 'self' argument. + * go32-nat.c (go32_terminal_init): Add 'self' argument. + * gnu-nat.c (gnu_terminal_init_inferior): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index ac981931247..88216a18a29 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2257,7 +2257,7 @@ gnu_detach (struct target_ops *ops, const char *args, int from_tty) } static void -gnu_terminal_init_inferior (void) +gnu_terminal_init_inferior (struct target_ops *self) { gdb_assert (gnu_current_inf); terminal_init_inferior_with_pgrp (gnu_current_inf->pid); diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 1529cc3d5ae..25267aace2f 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -845,7 +845,7 @@ static int inf_terminal_mode; static int terminal_is_ours = 1; static void -go32_terminal_init (void) +go32_terminal_init (struct target_ops *self) { inf_mode_valid = 0; /* Reinitialize, in case they are restarting child. */ terminal_is_ours = 1; diff --git a/gdb/inferior.h b/gdb/inferior.h index 290980a8671..41e396ac91e 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -178,7 +178,7 @@ extern void terminal_ours_for_output (void); extern void terminal_inferior (void); -extern void terminal_init_inferior (void); +extern void terminal_init_inferior (struct target_ops *self); extern void terminal_init_inferior_with_pgrp (int pgrp); diff --git a/gdb/inflow.c b/gdb/inflow.c index 5503a42518c..236f8f004db 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -255,7 +255,7 @@ terminal_save_ours (void) } void -terminal_init_inferior (void) +terminal_init_inferior (struct target_ops *self) { #ifdef PROCESS_GROUP_TYPE /* This is for Lynx, and should be cleaned up by having Lynx be a separate diff --git a/gdb/target.c b/gdb/target.c index 6836c9d2796..bc3176a03b3 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -132,7 +132,7 @@ static int debug_to_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR, int, int, struct expression *); -static void debug_to_terminal_init (void); +static void debug_to_terminal_init (struct target_ops *self); static void debug_to_terminal_inferior (void); @@ -769,7 +769,7 @@ update_current_target (void) struct expression *)) return_zero); de_fault (to_terminal_init, - (void (*) (void)) + (void (*) (struct target_ops *)) target_ignore); de_fault (to_terminal_inferior, (void (*) (void)) @@ -4799,9 +4799,9 @@ debug_to_remove_watchpoint (struct target_ops *self, } static void -debug_to_terminal_init (void) +debug_to_terminal_init (struct target_ops *self) { - debug_target.to_terminal_init (); + debug_target.to_terminal_init (&debug_target); fprintf_unfiltered (gdb_stdlog, "target_terminal_init ()\n"); } diff --git a/gdb/target.h b/gdb/target.h index d164a54462a..661b8e91aab 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -487,7 +487,7 @@ struct target_ops struct expression *); int (*to_masked_watch_num_registers) (struct target_ops *, CORE_ADDR, CORE_ADDR); - void (*to_terminal_init) (void); + void (*to_terminal_init) (struct target_ops *); void (*to_terminal_inferior) (void); void (*to_terminal_ours_for_output) (void); void (*to_terminal_ours) (void); @@ -1222,7 +1222,7 @@ extern int target_remove_breakpoint (struct gdbarch *gdbarch, before we actually run the inferior. */ #define target_terminal_init() \ - (*current_target.to_terminal_init) () + (*current_target.to_terminal_init) (¤t_target) /* Put the inferior's terminal settings into effect. This is preparation for starting or resuming the inferior. */ -- 2.30.2