Add target_ops argument to to_close

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.
This commit is contained in:
Tom Tromey 2013-12-17 21:27:56 -07:00
parent 9dd130a0f0
commit de90e03d4c
21 changed files with 52 additions and 28 deletions

View File

@ -1,3 +1,28 @@
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.

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

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

View 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

View File

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

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

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

View 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

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

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

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

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

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

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

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

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

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

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

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

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

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