Add target_ops argument to to_close
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:27:56 +0000 (21:27 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:45:28 +0000 (07:45 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* windows-nat.c (windows_close): Add 'self' argument.
* tracepoint.c (tfile_close): Add 'self' argument.
* target.h (struct target_ops) <to_close>: Add argument.
* target.c (target_close): Add argument.
(update_current_target): Update.
* remote.c (remote_close): Add 'self' argument.
* remote-sim.c (gdbsim_close): Add 'self' argument.
* remote-mips.c (mips_close): Add 'self' argument.
* remote-m32r-sdi.c (m32r_close): Add 'self' argument.
* record-full.c (record_full_close): Add 'self' argument.
* record-btrace.c (record_btrace_close): Add 'self' argument.
* monitor.h (monitor_close): Add 'self' argument.
* monitor.c (monitor_close): Add 'self' argument.
* mips-linux-nat.c (mips_linux_close): Add 'self' argument.
* linux-nat.c (linux_nat_close): Add argument.
* go32-nat.c (go32_close): Add 'self' argument.
* exec.c (exec_close_1): Add 'self' argument.
* ctf.c (ctf_close): Add 'self' argument.
* corelow.c (core_close): Add 'self' argument.
(core_close_cleanup): Update.
* bsd-uthread.c (bsd_uthread_close): Add 'self' argument.
* bsd-kvm.c (bsd_kvm_close): Add 'self' argument.

21 files changed:
gdb/ChangeLog
gdb/bsd-kvm.c
gdb/bsd-uthread.c
gdb/corelow.c
gdb/ctf.c
gdb/exec.c
gdb/go32-nat.c
gdb/linux-nat.c
gdb/mips-linux-nat.c
gdb/monitor.c
gdb/monitor.h
gdb/record-btrace.c
gdb/record-full.c
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/remote-sim.c
gdb/remote.c
gdb/target.c
gdb/target.h
gdb/tracepoint.c
gdb/windows-nat.c

index 83910b0..a98901b 100644 (file)
@@ -1,5 +1,30 @@
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
+       * windows-nat.c (windows_close): Add 'self' argument.
+       * tracepoint.c (tfile_close): Add 'self' argument.
+       * target.h (struct target_ops) <to_close>: Add argument.
+       * target.c (target_close): Add argument.
+       (update_current_target): Update.
+       * remote.c (remote_close): Add 'self' argument.
+       * remote-sim.c (gdbsim_close): Add 'self' argument.
+       * remote-mips.c (mips_close): Add 'self' argument.
+       * remote-m32r-sdi.c (m32r_close): Add 'self' argument.
+       * record-full.c (record_full_close): Add 'self' argument.
+       * record-btrace.c (record_btrace_close): Add 'self' argument.
+       * monitor.h (monitor_close): Add 'self' argument.
+       * monitor.c (monitor_close): Add 'self' argument.
+       * mips-linux-nat.c (mips_linux_close): Add 'self' argument.
+       * linux-nat.c (linux_nat_close): Add argument.
+       * go32-nat.c (go32_close): Add 'self' argument.
+       * exec.c (exec_close_1): Add 'self' argument.
+       * ctf.c (ctf_close): Add 'self' argument.
+       * corelow.c (core_close): Add 'self' argument.
+       (core_close_cleanup): Update.
+       * bsd-uthread.c (bsd_uthread_close): Add 'self' argument.
+       * bsd-kvm.c (bsd_kvm_close): Add 'self' argument.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
        * remote.c (remote_load): New function.
        (init_remote_ops): Use it.
 
index fa7f83c..35ecebb 100644 (file)
@@ -105,7 +105,7 @@ bsd_kvm_open (char *filename, int from_tty)
 }
 
 static void
-bsd_kvm_close (void)
+bsd_kvm_close (struct target_ops *self)
 {
   if (core_kd)
     {
index bf6c390..d235f41 100644 (file)
@@ -204,7 +204,7 @@ bsd_uthread_activate (struct objfile *objfile)
 /* Cleanup due to deactivation.  */
 
 static void
-bsd_uthread_close (void)
+bsd_uthread_close (struct target_ops *self)
 {
   bsd_uthread_active = 0;
   bsd_uthread_thread_run_addr = 0;
index 382bbb2..8a80be3 100644 (file)
@@ -85,7 +85,7 @@ static int gdb_check_format (bfd *);
 
 static void core_open (char *, int);
 
-static void core_close (void);
+static void core_close (struct target_ops *self);
 
 static void core_close_cleanup (void *ignore);
 
@@ -192,7 +192,7 @@ gdb_check_format (bfd *abfd)
    stack spaces as empty.  */
 
 static void
-core_close (void)
+core_close (struct target_ops *self)
 {
   if (core_bfd)
     {
@@ -223,7 +223,7 @@ core_close (void)
 static void
 core_close_cleanup (void *ignore)
 {
-  core_close ();
+  core_close (NULL);
 }
 
 /* Look for sections whose names start with `.reg/' so that we can
index 71453df..38c8abb 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1204,7 +1204,7 @@ ctf_open (char *dirname, int from_tty)
    CTF iterator and context.  */
 
 static void
-ctf_close (void)
+ctf_close (struct target_ops *self)
 {
   int pid;
 
index 23d6187..1885afd 100644 (file)
@@ -112,7 +112,7 @@ exec_close (void)
    sections and closes all executable bfds from all program spaces.  */
 
 static void
-exec_close_1 (void)
+exec_close_1 (struct target_ops *self)
 {
   using_exec_ops = 0;
 
index 7dc6307..1529cc3 100644 (file)
@@ -234,7 +234,6 @@ static int dr_ref_count[4];
 #define SOME_PID 42
 
 static int prog_has_started = 0;
-
 static void go32_mourn_inferior (struct target_ops *ops);
 
 static struct target_ops go32_ops;
@@ -347,7 +346,7 @@ go32_open (char *name, int from_tty)
 }
 
 static void
-go32_close (void)
+go32_close (struct target_ops *self)
 {
 }
 
index 6c31c3b..a76ba30 100644 (file)
@@ -4788,14 +4788,14 @@ linux_nat_stop (ptid_t ptid)
 }
 
 static void
-linux_nat_close (void)
+linux_nat_close (struct target_ops *self)
 {
   /* Unregister from the event loop.  */
   if (linux_nat_is_async_p (NULL))
     linux_nat_async (NULL, NULL, 0);
 
   if (linux_ops->to_close)
-    linux_ops->to_close ();
+    linux_ops->to_close (linux_ops);
 }
 
 /* When requests are passed down from the linux-nat layer to the
index 627241f..98f8d96 100644 (file)
@@ -744,7 +744,7 @@ mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
    super implementation.  */
 
 static void
-mips_linux_close (void)
+mips_linux_close (struct target_ops *self)
 {
   struct mips_watchpoint *w;
   struct mips_watchpoint *nw;
index 6c5154f..e88b28c 100644 (file)
@@ -853,7 +853,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
    control.  */
 
 void
-monitor_close (void)
+monitor_close (struct target_ops *self)
 {
   if (monitor_desc)
     serial_close (monitor_desc);
index c7e7af8..07caf97 100644 (file)
@@ -240,7 +240,7 @@ struct monitor_ops
 #define SREC_SIZE 160
 
 extern void monitor_open (char *args, struct monitor_ops *ops, int from_tty);
-extern void monitor_close (void);
+extern void monitor_close (struct target_ops *self);
 extern char *monitor_supply_register (struct regcache *regcache,
                                      int regno, char *valstr);
 extern int monitor_expect (char *prompt, char *buf, int buflen);
index b7a549a..75a1364 100644 (file)
@@ -211,7 +211,7 @@ record_btrace_stop_recording (void)
 /* The to_close method of target record-btrace.  */
 
 static void
-record_btrace_close (void)
+record_btrace_close (struct target_ops *self)
 {
   struct thread_info *tp;
 
index 0452dca..04ba714 100644 (file)
@@ -877,7 +877,7 @@ record_full_open (char *name, int from_tty)
 /* "to_close" target method.  Close the process record target.  */
 
 static void
-record_full_close (void)
+record_full_close (struct target_ops *self)
 {
   struct record_full_core_buf_entry *entry;
 
index 48c4b4b..0bcfb1f 100644 (file)
@@ -429,7 +429,7 @@ m32r_open (char *args, int from_tty)
 /* Close out all files and local state before this target loses control.  */
 
 static void
-m32r_close (void)
+m32r_close (struct target_ops *self)
 {
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "m32r_close()\n");
index 6109e64..8dde5cc 100644 (file)
@@ -84,7 +84,7 @@ static void ddb_open (char *name, int from_tty);
 
 static void lsi_open (char *name, int from_tty);
 
-static void mips_close (void);
+static void mips_close (struct target_ops *self);
 
 static int mips_map_regno (struct gdbarch *, int);
 
@@ -1732,7 +1732,7 @@ lsi_open (char *name, int from_tty)
 /* Close a connection to the remote board.  */
 
 static void
-mips_close (void)
+mips_close (struct target_ops *self)
 {
   if (mips_is_open)
     {
index 163af41..1855f39 100644 (file)
@@ -76,7 +76,7 @@ static void gdbsim_load (char *prog, int fromtty);
 
 static void gdbsim_open (char *args, int from_tty);
 
-static void gdbsim_close (void);
+static void gdbsim_close (struct target_ops *self);
 
 static void gdbsim_detach (struct target_ops *ops, const char *args,
                           int from_tty);
@@ -788,7 +788,7 @@ gdbsim_close_inferior (struct inferior *inf, void *arg)
 /* Close out all files and local state before this target loses control.  */
 
 static void
-gdbsim_close (void)
+gdbsim_close (struct target_ops *self)
 {
   struct sim_inferior_data *sim_data
     = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
index 9e0045a..fb90c55 100644 (file)
@@ -107,7 +107,7 @@ static void extended_remote_open (char *name, int from_tty);
 
 static void remote_open_1 (char *, int, struct target_ops *, int extended_p);
 
-static void remote_close (void);
+static void remote_close (struct target_ops *self);
 
 static void remote_mourn (struct target_ops *ops);
 
@@ -2991,7 +2991,7 @@ extended_remote_restart (void)
 /* Clean up connection to a remote debugger.  */
 
 static void
-remote_close (void)
+remote_close (struct target_ops *self)
 {
   struct remote_state *rs = get_remote_state ();
 
index 7ac8728..e63725a 100644 (file)
@@ -718,7 +718,7 @@ update_current_target (void)
            (void (*) (char *, int))
            tcomplain);
   de_fault (to_close,
-           (void (*) (void))
+           (void (*) (struct target_ops *))
            target_ignore);
   de_fault (to_post_attach,
            (void (*) (int))
@@ -3833,7 +3833,7 @@ target_close (struct target_ops *targ)
   if (targ->to_xclose != NULL)
     targ->to_xclose (targ);
   else if (targ->to_close != NULL)
-    targ->to_close ();
+    targ->to_close (targ);
 
   if (targetdebug)
     fprintf_unfiltered (gdb_stdlog, "target_close ()\n");
index 7709c16..125d649 100644 (file)
@@ -402,7 +402,7 @@ struct target_ops
        New re-entrant targets provide "to_xclose" and that is expected
        to xfree everything (including the "struct target_ops").  */
     void (*to_xclose) (struct target_ops *targ);
-    void (*to_close) (void);
+    void (*to_close) (struct target_ops *);
     void (*to_attach) (struct target_ops *ops, char *, int);
     void (*to_post_attach) (int);
     void (*to_detach) (struct target_ops *ops, const char *, int);
index 80d0620..47b3190 100644 (file)
@@ -4756,7 +4756,7 @@ parse_tsv_definition (char *line, struct uploaded_tsv **utsvp)
 /* Close the trace file and generally clean up.  */
 
 static void
-tfile_close (void)
+tfile_close (struct target_ops *self)
 {
   int pid;
 
index 9212adf..8dcc410 100644 (file)
@@ -2481,7 +2481,7 @@ windows_can_run (void)
 }
 
 static void
-windows_close (void)
+windows_close (struct target_ops *self)
 {
   DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n",
                ptid_get_pid (inferior_ptid)));