From d2f640d43aee0be2d12eb082ac3d48d99ab5a1ce Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:30:23 -0700 Subject: [PATCH] Add target_ops argument to to_terminal_inferior 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. * target.c (target_terminal_inferior): Add argument. (update_current_target): Update. * remote.c (remote_terminal_inferior): Add 'self' argument. * linux-nat.c (linux_nat_terminal_inferior): Add 'self' argument. * inflow.c (terminal_inferior): Add 'self' argument. * inferior.h (terminal_inferior): Add 'self' argument. * go32-nat.c (go32_terminal_inferior): Add 'self' argument. (go32_terminal_inferior): Add 'self' argument. --- gdb/ChangeLog | 13 +++++++++++++ gdb/go32-nat.c | 2 +- gdb/inferior.h | 2 +- gdb/inflow.c | 2 +- gdb/linux-nat.c | 6 +++--- gdb/remote.c | 2 +- gdb/target.c | 10 +++++----- gdb/target.h | 2 +- 8 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 93b0d51db0..a817e1b175 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add + argument. + * target.c (target_terminal_inferior): Add argument. + (update_current_target): Update. + * remote.c (remote_terminal_inferior): Add 'self' argument. + * linux-nat.c (linux_nat_terminal_inferior): Add 'self' argument. + * inflow.c (terminal_inferior): Add 'self' argument. + * inferior.h (terminal_inferior): Add 'self' argument. + * go32-nat.c (go32_terminal_inferior): Add 'self' argument. + (go32_terminal_inferior): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 25267aace2..8f911e2e61 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -882,7 +882,7 @@ go32_terminal_info (const char *args, int from_tty) } static void -go32_terminal_inferior (void) +go32_terminal_inferior (struct target_ops *self) { /* Redirect standard handles as child wants them. */ errno = 0; diff --git a/gdb/inferior.h b/gdb/inferior.h index 41e396ac91..5acbee4cb6 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -176,7 +176,7 @@ extern void term_info (char *, int); extern void terminal_ours_for_output (void); -extern void terminal_inferior (void); +extern void terminal_inferior (struct target_ops *self); extern void terminal_init_inferior (struct target_ops *self); diff --git a/gdb/inflow.c b/gdb/inflow.c index 236f8f004d..72706f57ef 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -272,7 +272,7 @@ terminal_init_inferior (struct target_ops *self) This is preparation for starting or resuming the inferior. */ void -terminal_inferior (void) +terminal_inferior (struct target_ops *self) { struct inferior *inf; struct terminal_info *tinfo; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index a6118affb9..cd2798ae77 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4583,16 +4583,16 @@ static int async_terminal_is_ours = 1; /* target_terminal_inferior implementation. */ static void -linux_nat_terminal_inferior (void) +linux_nat_terminal_inferior (struct target_ops *self) { if (!target_is_async_p ()) { /* Async mode is disabled. */ - terminal_inferior (); + terminal_inferior (self); return; } - terminal_inferior (); + terminal_inferior (self); /* Calls to target_terminal_*() are meant to be idempotent. */ if (!async_terminal_is_ours) diff --git a/gdb/remote.c b/gdb/remote.c index 6424304b5b..456cd09e67 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5125,7 +5125,7 @@ Give up (and stop debugging it)? "))) is required. */ static void -remote_terminal_inferior (void) +remote_terminal_inferior (struct target_ops *self) { if (!target_async_permitted) /* Nothing to do. */ diff --git a/gdb/target.c b/gdb/target.c index bc3176a03b..f3a6b8012e 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -134,7 +134,7 @@ static int debug_to_can_accel_watchpoint_condition (struct target_ops *self, static void debug_to_terminal_init (struct target_ops *self); -static void debug_to_terminal_inferior (void); +static void debug_to_terminal_inferior (struct target_ops *self); static void debug_to_terminal_ours_for_output (void); @@ -500,7 +500,7 @@ target_terminal_inferior (void) /* If GDB is resuming the inferior in the foreground, install inferior's terminal modes. */ - (*current_target.to_terminal_inferior) (); + (*current_target.to_terminal_inferior) (¤t_target); } static int @@ -772,7 +772,7 @@ update_current_target (void) (void (*) (struct target_ops *)) target_ignore); de_fault (to_terminal_inferior, - (void (*) (void)) + (void (*) (struct target_ops *)) target_ignore); de_fault (to_terminal_ours_for_output, (void (*) (void)) @@ -4807,9 +4807,9 @@ debug_to_terminal_init (struct target_ops *self) } static void -debug_to_terminal_inferior (void) +debug_to_terminal_inferior (struct target_ops *self) { - debug_target.to_terminal_inferior (); + debug_target.to_terminal_inferior (&debug_target); fprintf_unfiltered (gdb_stdlog, "target_terminal_inferior ()\n"); } diff --git a/gdb/target.h b/gdb/target.h index 661b8e91aa..bb68ac0bed 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -488,7 +488,7 @@ struct target_ops int (*to_masked_watch_num_registers) (struct target_ops *, CORE_ADDR, CORE_ADDR); void (*to_terminal_init) (struct target_ops *); - void (*to_terminal_inferior) (void); + void (*to_terminal_inferior) (struct target_ops *); void (*to_terminal_ours_for_output) (void); void (*to_terminal_ours) (void); void (*to_terminal_save_ours) (void); -- 2.34.1