Add target_ops argument to to_terminal_ours

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.
This commit is contained in:
Tom Tromey 2013-12-17 21:30:49 -07:00
parent 2e1e1a193c
commit e3594fd196
8 changed files with 28 additions and 15 deletions

View 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>

View 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. */

View 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,

View 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);
}

View 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;

View 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. */

View 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");
}

View 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