This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC v2 08/38] Add target_ops argument to to_terminal_init


2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_terminal_init>: 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.

Add target_ops argument to to_terminal_inferior

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_terminal_inferior>: 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.

Add target_ops argument to to_terminal_ours_for_output

2014-02-06  Pedro Alves  <palves@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_terminal_ours_for_output>: Add
	argument.
	(target_terminal_ours_for_output): Add argument.
	* target.c (debug_to_terminal_ours_for_output): Add argument.
	(update_current_target): Update.
	* inflow.c (terminal_ours_for_output): Add 'self' argument.
	* inferior.h (terminal_ours_for_output): Add 'self' argument.
	* go32-nat.c (go32_terminal_ours): Add 'self' argument.

Add target_ops argument to to_terminal_ours

2014-02-06  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.

Add target_ops argument to to_terminal_save_ours

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_terminal_save_ours>: Add
	argument.
	(target_terminal_save_ours): Add argument.
	* target.c (debug_to_terminal_save_ours): Add argument.
	(update_current_target): Update.
	* inflow.c (terminal_save_ours): Add 'self' argument.
	* inferior.h (terminal_save_ours): Add 'self' argument.

Add target_ops argument to to_terminal_info

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_terminal_info>: Add argument.
	(target_terminal_info): Add argument.
	* target.c (debug_to_terminal_info): Add argument.
	(default_terminal_info): Likewise.
	* inflow.c (child_terminal_info): Add 'self' argument.
	* inferior.h (child_terminal_info): Add 'self' argument.
	* go32-nat.c (go32_terminal_info): Add 'self' argument.

Add target_ops argument to to_load

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_load>: Add argument.
	* target.c (target_load): Add argument.
	(debug_to_load): Add argument.
	(update_current_target): Update.
	* remote.c (remote_load): Add 'self' argument.
	* remote-sim.c (gdbsim_load): Add 'self' argument.
	* remote-mips.c (mips_load): Add 'self' argument.
	* remote-m32r-sdi.c (m32r_load): Add 'self' argument.
	* monitor.c (monitor_load): Add 'self' argument.
	* m32r-rom.c (m32r_load_gen): Add 'self' argument.

Add target_ops argument to to_post_startup_inferior

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_post_startup_inferior>: Add
	argument.
	(target_post_startup_inferior): Add argument.
	* target.c (debug_to_post_startup_inferior): Add argument.
	(update_current_target): Update.
	* spu-linux-nat.c (spu_child_post_startup_inferior): Add 'self'
	argument.
	* linux-nat.c (linux_child_post_startup_inferior): Add 'self'
	argument.
	* inf-ptrace.c (inf_ptrace_post_startup_inferior): Add 'self'
	argument.
	* inf-child.c (inf_child_post_startup_inferior): Add 'self'
	argument.
	* i386-linux-nat.c (i386_linux_child_post_startup_inferior): Add
	'self' argument.
	(super_post_startup_inferior): Likewise.
	* amd64-linux-nat.c (amd64_linux_child_post_startup_inferior): Add
	'self' argument.
	(super_post_startup_inferior): Likewise.
	* aarch64-linux-nat.c (aarch64_linux_child_post_startup_inferior):
	Add 'self' argument.
	(super_post_startup_inferior): Likewise.

Add target_ops argument to to_insert_fork_catchpoint

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_insert_fork_catchpoint>: Add
	argument.
	(target_insert_fork_catchpoint): Add argument.
	* target.c (debug_to_insert_fork_catchpoint): Add argument.
	(update_current_target): Update.
	* linux-nat.c (linux_child_insert_fork_catchpoint): Add 'self'
	argument.

Add target_ops argument to to_remove_fork_catchpoint

2014-02-06  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_remove_fork_catchpoint>: Add
	argument.
	(target_remove_fork_catchpoint): Add argument.
	* target.c (debug_to_remove_fork_catchpoint): Add argument.
	(update_current_target): Update.
	* linux-nat.c (linux_child_remove_fork_catchpoint): Add 'self'
	argument.
---
 gdb/ChangeLog           | 127 ++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/aarch64-linux-nat.c |   8 +--
 gdb/amd64-linux-nat.c   |   7 +--
 gdb/gnu-nat.c           |   2 +-
 gdb/go32-nat.c          |   8 +--
 gdb/i386-linux-nat.c    |   7 +--
 gdb/inf-child.c         |   2 +-
 gdb/inf-ptrace.c        |   2 +-
 gdb/inferior.h          |  12 ++---
 gdb/inflow.c            |  12 ++---
 gdb/linux-nat.c         |  18 +++----
 gdb/m32r-rom.c          |   2 +-
 gdb/monitor.c           |   2 +-
 gdb/remote-m32r-sdi.c   |   2 +-
 gdb/remote-mips.c       |   4 +-
 gdb/remote-sim.c        |   4 +-
 gdb/remote.c            |  10 ++--
 gdb/spu-linux-nat.c     |   2 +-
 gdb/target.c            |  79 +++++++++++++++---------------
 gdb/target.h            |  36 +++++++-------
 20 files changed, 239 insertions(+), 107 deletions(-)

diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index c6437fe..28ad38b 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -828,16 +828,18 @@ aarch64_linux_get_debug_reg_capacity (void)
     }
 }
 
-static void (*super_post_startup_inferior) (ptid_t ptid);
+static void (*super_post_startup_inferior) (struct target_ops *self,
+					    ptid_t ptid);
 
 /* Implement the "to_post_startup_inferior" target_ops method.  */
 
 static void
-aarch64_linux_child_post_startup_inferior (ptid_t ptid)
+aarch64_linux_child_post_startup_inferior (struct target_ops *self,
+					   ptid_t ptid)
 {
   aarch64_forget_process (ptid_get_pid (ptid));
   aarch64_linux_get_debug_reg_capacity ();
-  super_post_startup_inferior (ptid);
+  super_post_startup_inferior (self, ptid);
 }
 
 /* Implement the "to_read_description" target_ops method.  */
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 55973a6..af84142 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -568,13 +568,14 @@ ps_get_thread_area (const struct ps_prochandle *ph,
 }
 
 
-static void (*super_post_startup_inferior) (ptid_t ptid);
+static void (*super_post_startup_inferior) (struct target_ops *self,
+					    ptid_t ptid);
 
 static void
-amd64_linux_child_post_startup_inferior (ptid_t ptid)
+amd64_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   i386_cleanup_dregs ();
-  super_post_startup_inferior (ptid);
+  super_post_startup_inferior (self, ptid);
 }
 
 
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index ca61c11..8591293 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2244,7 +2244,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 1529cc3..75f6a3e 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -845,14 +845,14 @@ 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;
 }
 
 static void
-go32_terminal_info (const char *args, int from_tty)
+go32_terminal_info (struct target_ops *self, const char *args, int from_tty)
 {
   printf_unfiltered ("Inferior's terminal is in %s mode.\n",
 		     !inf_mode_valid
@@ -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;
@@ -903,7 +903,7 @@ go32_terminal_inferior (void)
 }
 
 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.  */
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index fdf5dee..f7be40c 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -982,13 +982,14 @@ i386_linux_resume (struct target_ops *ops,
     perror_with_name (("ptrace"));
 }
 
-static void (*super_post_startup_inferior) (ptid_t ptid);
+static void (*super_post_startup_inferior) (struct target_ops *self,
+					    ptid_t ptid);
 
 static void
-i386_linux_child_post_startup_inferior (ptid_t ptid)
+i386_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   i386_cleanup_dregs ();
-  super_post_startup_inferior (ptid);
+  super_post_startup_inferior (self, ptid);
 }
 
 /* Get Linux/x86 target description from running target.  */
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index c142912..7726470 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -112,7 +112,7 @@ inf_child_open (char *arg, int from_tty)
 }
 
 static void
-inf_child_post_startup_inferior (ptid_t ptid)
+inf_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   /* This version of Unix doesn't require a meaningful "post startup
      inferior" operation by a debugger.  */
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index d054126..7180fb4 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -147,7 +147,7 @@ inf_ptrace_create_inferior (struct target_ops *ops,
 #ifdef PT_GET_PROCESS_STATE
 
 static void
-inf_ptrace_post_startup_inferior (ptid_t pid)
+inf_ptrace_post_startup_inferior (struct target_ops *self, ptid_t pid)
 {
   ptrace_event_t pe;
 
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 290980a8..43e035b 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -125,9 +125,9 @@ extern int disable_randomization;
 
 extern void generic_mourn_inferior (void);
 
-extern void terminal_save_ours (void);
+extern void terminal_save_ours (struct target_ops *self);
 
-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,
@@ -170,15 +170,15 @@ extern void default_print_registers_info (struct gdbarch *gdbarch,
 					  struct frame_info *frame,
 					  int regnum, int all);
 
-extern void child_terminal_info (const char *, int);
+extern void child_terminal_info (struct target_ops *self, const char *, int);
 
 extern void term_info (char *, int);
 
-extern void terminal_ours_for_output (void);
+extern void terminal_ours_for_output (struct target_ops *self);
 
-extern void terminal_inferior (void);
+extern void terminal_inferior (struct target_ops *self);
 
-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 5503a42..09623ab 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -245,7 +245,7 @@ terminal_init_inferior_with_pgrp (int pgrp)
    and gdb must be able to restore it correctly.  */
 
 void
-terminal_save_ours (void)
+terminal_save_ours (struct target_ops *self)
 {
   if (gdb_has_a_terminal ())
     {
@@ -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
@@ -272,7 +272,7 @@ terminal_init_inferior (void)
    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;
@@ -353,7 +353,7 @@ terminal_inferior (void)
    should be called to get back to a normal state of affairs.  */
 
 void
-terminal_ours_for_output (void)
+terminal_ours_for_output (struct target_ops *self)
 {
   terminal_ours_1 (1);
 }
@@ -363,7 +363,7 @@ terminal_ours_for_output (void)
    so they can be restored properly later.  */
 
 void
-terminal_ours (void)
+terminal_ours (struct target_ops *self)
 {
   terminal_ours_1 (0);
 }
@@ -562,7 +562,7 @@ term_info (char *arg, int from_tty)
 }
 
 void
-child_terminal_info (const char *args, int from_tty)
+child_terminal_info (struct target_ops *self, const char *args, int from_tty)
 {
   struct inferior *inf;
   struct terminal_info *tinfo;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 0475eb3..45d4053 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -335,7 +335,7 @@ linux_child_post_attach (struct target_ops *self, int pid)
 }
 
 static void
-linux_child_post_startup_inferior (ptid_t ptid)
+linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   linux_init_ptrace (ptid_get_pid (ptid));
 }
@@ -696,13 +696,13 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 
 
 static int
-linux_child_insert_fork_catchpoint (int pid)
+linux_child_insert_fork_catchpoint (struct target_ops *self, int pid)
 {
   return !linux_supports_tracefork ();
 }
 
 static int
-linux_child_remove_fork_catchpoint (int pid)
+linux_child_remove_fork_catchpoint (struct target_ops *self, int pid)
 {
   return 0;
 }
@@ -4546,16 +4546,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)
@@ -4569,19 +4569,19 @@ linux_nat_terminal_inferior (void)
 /* 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;
diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c
index 6219891..2ca23ae 100644
--- a/gdb/m32r-rom.c
+++ b/gdb/m32r-rom.c
@@ -196,7 +196,7 @@ m32r_load (char *filename, int from_tty)
 }
 
 static void
-m32r_load_gen (char *filename, int from_tty)
+m32r_load_gen (struct target_ops *self, char *filename, int from_tty)
 {
   generic_load (filename, from_tty);
 }
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 8129d20..3f5a067 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2194,7 +2194,7 @@ monitor_wait_srec_ack (void)
 /* monitor_load -- download a file.  */
 
 static void
-monitor_load (char *args, int from_tty)
+monitor_load (struct target_ops *self, char *args, int from_tty)
 {
   CORE_ADDR load_offset = 0;
   char **argv;
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index 37649e4..0af8cfc 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1213,7 +1213,7 @@ m32r_remove_breakpoint (struct target_ops *ops,
 }
 
 static void
-m32r_load (char *args, int from_tty)
+m32r_load (struct target_ops *self, char *args, int from_tty)
 {
   struct cleanup *old_chain;
   asection *section;
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index e8ef449..4338ffa 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -128,7 +128,7 @@ static void pmon_download (char *buffer, int length);
 
 static void pmon_load_fast (char *file);
 
-static void mips_load (char *file, int from_tty);
+static void mips_load (struct target_ops *self, char *file, int from_tty);
 
 static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr,
 			   unsigned char *myaddr, int len);
@@ -3530,7 +3530,7 @@ pmon_load_fast (char *file)
 /* mips_load -- download a file.  */
 
 static void
-mips_load (char *file, int from_tty)
+mips_load (struct target_ops *self, char *file, int from_tty)
 {
   struct regcache *regcache;
 
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 220ce9d..31107f7 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -72,7 +72,7 @@ static void gdb_os_error (host_callback *, const char *, ...)
 
 static void gdbsim_kill (struct target_ops *);
 
-static void gdbsim_load (char *prog, int fromtty);
+static void gdbsim_load (struct target_ops *self, char *prog, int fromtty);
 
 static void gdbsim_open (char *args, int from_tty);
 
@@ -561,7 +561,7 @@ gdbsim_kill (struct target_ops *ops)
    GDB's symbol tables to match.  */
 
 static void
-gdbsim_load (char *args, int fromtty)
+gdbsim_load (struct target_ops *self, char *args, int fromtty)
 {
   char **argv;
   char *prog;
diff --git a/gdb/remote.c b/gdb/remote.c
index dedfc77..8179c9a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -225,7 +225,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);
 
@@ -3068,7 +3068,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;
@@ -5255,7 +5255,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.  */
@@ -5278,7 +5278,7 @@ remote_terminal_inferior (void)
 }
 
 static void
-remote_terminal_ours (void)
+remote_terminal_ours (struct target_ops *self)
 {
   if (!target_async_permitted)
     /* Nothing to do.  */
@@ -11542,7 +11542,7 @@ remote_augmented_libraries_svr4_read (void)
 /* Implementation of to_load.  */
 
 static void
-remote_load (char *name, int from_tty)
+remote_load (struct target_ops *self, char *name, int from_tty)
 {
   generic_load (name, from_tty);
 }
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index ab80abf..ec924cb 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -390,7 +390,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
 /* Override the post_startup_inferior routine to continue running
    the inferior until the first spu_run system call.  */
 static void
-spu_child_post_startup_inferior (ptid_t ptid)
+spu_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   int fd;
   ULONGEST addr;
diff --git a/gdb/target.c b/gdb/target.c
index 7ed433f..02e4c6b 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -47,7 +47,7 @@
 
 static void target_info (char *, int);
 
-static void default_terminal_info (const char *, int);
+static void default_terminal_info (struct target_ops *, const char *, int);
 
 static int default_watchpoint_addr_within_range (struct target_ops *,
 						 CORE_ADDR, CORE_ADDR, int);
@@ -132,17 +132,17 @@ 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);
+static void debug_to_terminal_inferior (struct target_ops *self);
 
-static void debug_to_terminal_ours_for_output (void);
+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_save_ours (struct target_ops *self);
 
-static void debug_to_terminal_ours (void);
+static void debug_to_terminal_ours (struct target_ops *self);
 
-static void debug_to_load (char *, int);
+static void debug_to_load (struct target_ops *self, char *, int);
 
 static int debug_to_can_run (void);
 
@@ -462,7 +462,7 @@ void
 target_load (char *arg, int from_tty)
 {
   target_dcache_invalidate ();
-  (*current_target.to_load) (arg, from_tty);
+  (*current_target.to_load) (&current_target, arg, from_tty);
 }
 
 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) (&current_target);
 }
 
 static int
@@ -525,7 +525,7 @@ noprocess (void)
 }
 
 static void
-default_terminal_info (const char *args, int from_tty)
+default_terminal_info (struct target_ops *self, const char *args, int from_tty)
 {
   printf_unfiltered (_("No saved terminal information.\n"));
 }
@@ -769,33 +769,33 @@ 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))
+	    (void (*) (struct target_ops *))
 	    target_ignore);
   de_fault (to_terminal_ours_for_output,
-	    (void (*) (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))
+	    (void (*) (struct target_ops *))
 	    target_ignore);
   de_fault (to_terminal_info,
 	    default_terminal_info);
   de_fault (to_load,
-	    (void (*) (char *, int))
+	    (void (*) (struct target_ops *, char *, int))
 	    tcomplain);
   de_fault (to_post_startup_inferior,
-	    (void (*) (ptid_t))
+	    (void (*) (struct target_ops *, ptid_t))
 	    target_ignore);
   de_fault (to_insert_fork_catchpoint,
-	    (int (*) (int))
+	    (int (*) (struct target_ops *, int))
 	    return_one);
   de_fault (to_remove_fork_catchpoint,
-	    (int (*) (int))
+	    (int (*) (struct target_ops *, int))
 	    return_one);
   de_fault (to_insert_vfork_catchpoint,
 	    (int (*) (int))
@@ -4738,77 +4738,78 @@ 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");
 }
 
 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");
 }
 
 static void
-debug_to_terminal_ours_for_output (void)
+debug_to_terminal_ours_for_output (struct target_ops *self)
 {
-  debug_target.to_terminal_ours_for_output ();
+  debug_target.to_terminal_ours_for_output (&debug_target);
 
   fprintf_unfiltered (gdb_stdlog, "target_terminal_ours_for_output ()\n");
 }
 
 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");
 }
 
 static void
-debug_to_terminal_save_ours (void)
+debug_to_terminal_save_ours (struct target_ops *self)
 {
-  debug_target.to_terminal_save_ours ();
+  debug_target.to_terminal_save_ours (&debug_target);
 
   fprintf_unfiltered (gdb_stdlog, "target_terminal_save_ours ()\n");
 }
 
 static void
-debug_to_terminal_info (const char *arg, int from_tty)
+debug_to_terminal_info (struct target_ops *self,
+			const char *arg, int from_tty)
 {
-  debug_target.to_terminal_info (arg, from_tty);
+  debug_target.to_terminal_info (&debug_target, arg, from_tty);
 
   fprintf_unfiltered (gdb_stdlog, "target_terminal_info (%s, %d)\n", arg,
 		      from_tty);
 }
 
 static void
-debug_to_load (char *args, int from_tty)
+debug_to_load (struct target_ops *self, char *args, int from_tty)
 {
-  debug_target.to_load (args, from_tty);
+  debug_target.to_load (&debug_target, args, from_tty);
 
   fprintf_unfiltered (gdb_stdlog, "target_load (%s, %d)\n", args, from_tty);
 }
 
 static void
-debug_to_post_startup_inferior (ptid_t ptid)
+debug_to_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
-  debug_target.to_post_startup_inferior (ptid);
+  debug_target.to_post_startup_inferior (&debug_target, ptid);
 
   fprintf_unfiltered (gdb_stdlog, "target_post_startup_inferior (%d)\n",
 		      ptid_get_pid (ptid));
 }
 
 static int
-debug_to_insert_fork_catchpoint (int pid)
+debug_to_insert_fork_catchpoint (struct target_ops *self, int pid)
 {
   int retval;
 
-  retval = debug_target.to_insert_fork_catchpoint (pid);
+  retval = debug_target.to_insert_fork_catchpoint (&debug_target, pid);
 
   fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d) = %d\n",
 		      pid, retval);
@@ -4817,11 +4818,11 @@ debug_to_insert_fork_catchpoint (int pid)
 }
 
 static int
-debug_to_remove_fork_catchpoint (int pid)
+debug_to_remove_fork_catchpoint (struct target_ops *self, int pid)
 {
   int retval;
 
-  retval = debug_target.to_remove_fork_catchpoint (pid);
+  retval = debug_target.to_remove_fork_catchpoint (&debug_target, pid);
 
   fprintf_unfiltered (gdb_stdlog, "target_remove_fork_catchpoint (%d) = %d\n",
 		      pid, retval);
diff --git a/gdb/target.h b/gdb/target.h
index 50d5c20..2eface1 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -478,19 +478,19 @@ 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_inferior) (void);
-    void (*to_terminal_ours_for_output) (void);
-    void (*to_terminal_ours) (void);
-    void (*to_terminal_save_ours) (void);
-    void (*to_terminal_info) (const char *, int);
+    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) (struct target_ops *);
+    void (*to_terminal_save_ours) (struct target_ops *);
+    void (*to_terminal_info) (struct target_ops *, const char *, int);
     void (*to_kill) (struct target_ops *);
-    void (*to_load) (char *, int);
+    void (*to_load) (struct target_ops *, char *, int);
     void (*to_create_inferior) (struct target_ops *, 
 				char *, char *, char **, int);
-    void (*to_post_startup_inferior) (ptid_t);
-    int (*to_insert_fork_catchpoint) (int);
-    int (*to_remove_fork_catchpoint) (int);
+    void (*to_post_startup_inferior) (struct target_ops *, ptid_t);
+    int (*to_insert_fork_catchpoint) (struct target_ops *, int);
+    int (*to_remove_fork_catchpoint) (struct target_ops *, int);
     int (*to_insert_vfork_catchpoint) (int);
     int (*to_remove_vfork_catchpoint) (int);
     int (*to_follow_fork) (struct target_ops *, int, int);
@@ -1209,7 +1209,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) (&current_target)
 
 /* Put the inferior's terminal settings into effect.
    This is preparation for starting or resuming the inferior.  */
@@ -1225,14 +1225,14 @@ extern void target_terminal_inferior (void);
    should be called to get back to a normal state of affairs.  */
 
 #define target_terminal_ours_for_output() \
-     (*current_target.to_terminal_ours_for_output) ()
+     (*current_target.to_terminal_ours_for_output) (&current_target)
 
 /* Put our terminal settings into effect.
    First record the inferior's terminal settings
    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
@@ -1240,13 +1240,13 @@ extern void target_terminal_inferior (void);
    to take this change into account.  */
 
 #define target_terminal_save_ours() \
-     (*current_target.to_terminal_save_ours) ()
+     (*current_target.to_terminal_save_ours) (&current_target)
 
 /* Print useful information about our terminal status, if such a thing
    exists.  */
 
 #define target_terminal_info(arg, from_tty) \
-     (*current_target.to_terminal_info) (arg, from_tty)
+     (*current_target.to_terminal_info) (&current_target, arg, from_tty)
 
 /* Kill the inferior process.   Make it go away.  */
 
@@ -1285,7 +1285,7 @@ void target_create_inferior (char *exec_file, char *args,
    Such targets will supply an appropriate definition for this function.  */
 
 #define target_post_startup_inferior(ptid) \
-     (*current_target.to_post_startup_inferior) (ptid)
+     (*current_target.to_post_startup_inferior) (&current_target, ptid)
 
 /* On some targets, we can catch an inferior fork or vfork event when
    it occurs.  These functions insert/remove an already-created
@@ -1293,10 +1293,10 @@ void target_create_inferior (char *exec_file, char *args,
    catchpoint type is not supported and -1 for failure.  */
 
 #define target_insert_fork_catchpoint(pid) \
-     (*current_target.to_insert_fork_catchpoint) (pid)
+     (*current_target.to_insert_fork_catchpoint) (&current_target, pid)
 
 #define target_remove_fork_catchpoint(pid) \
-     (*current_target.to_remove_fork_catchpoint) (pid)
+     (*current_target.to_remove_fork_catchpoint) (&current_target, pid)
 
 #define target_insert_vfork_catchpoint(pid) \
      (*current_target.to_insert_vfork_catchpoint) (pid)
-- 
1.8.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]