Code cleanup.
	* bfd-target.c (target_bfd_xclose): Remove parameter quitting.
	* bsd-kvm.c (bsd_kvm_close): Likewise.
	* bsd-uthread.c (bsd_uthread_close): Likewise.
	* corelow.c (core_close): Likewise.
	(core_close_cleanup): Remove parameter quitting from a caller.
	* event-top.c (async_disconnect): Likewise.
	* exec.c (exec_close_1): Remove parameter quitting.
	* go32-nat.c (go32_close): Likewise.
	* linux-nat.c (linux_nat_close): Remove parameter quitting.  Remove
	parameter quitting from a caller.
	* mips-linux-nat.c (super_close): Remove parameter quitting from the
	variable.
	(mips_linux_close): Remove parameter quitting.  Remove parameter
	quitting from a caller.
	* monitor.c (monitor_close): Remove parameter quitting.
	* monitor.h (monitor_close): Likewise.
	* record-btrace.c (record_btrace_close): Likewise.
	* record-full.c (record_full_close): Likewise.
	* remote-m32r-sdi.c (m32r_close): Remove parameter quitting and remove
	it also from fprintf_unfiltered.
	* remote-mips.c (mips_close): Remove parameter quitting.
	(mips_detach): Remove parameter quitting from a caller.
	* remote-sim.c (gdbsim_close): Remove parameter quitting.
	(gdbsim_close): Remove duplicate function comment.  Remove parameter
	quitting and remove it also from printf_filtered.
	* remote.c (remote_close): Remove parameter quitting.
	* solib-svr4.c (enable_break): Remove parameter quitting from a caller.
	* target.c (update_current_target): Remove parameter int from to_close
	de_fault.
	(push_target, unpush_target, pop_target): Remove parameter quitting from
	a caller.
	(pop_all_targets_above, pop_all_targets): Remove parameter quitting.
	Remove parameter quitting from a caller.
	(target_preopen): Remove parameter quitting from a caller.
	(target_close): Remove parameter quitting.  Remove parameter quitting
	from a caller two times.  Remove parameter quitting also from
	fprintf_unfiltered.
	* target.h (struct target_ops): Remove parameter quitting and as int
	from fields to_xclose and to_close.
	(extern struct target_ops current_target):
	(target_close, pop_all_targets): Remove parameter quitting.  Update the
	comment.
	(pop_all_targets_above): Remove parameter quitting.
	* top.c (quit_target): Remove parameter quitting from a caller.
	* tracepoint.c (tfile_close): Remove parameter quitting.
	* windows-nat.c (windows_close): Remove parameter quitting.
This commit is contained in:
Jan Kratochvil 2013-03-20 15:46:24 +00:00
parent 33e32ca032
commit 460014f572
24 changed files with 107 additions and 70 deletions

View File

@ -1,3 +1,53 @@
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
* bfd-target.c (target_bfd_xclose): Remove parameter quitting.
* bsd-kvm.c (bsd_kvm_close): Likewise.
* bsd-uthread.c (bsd_uthread_close): Likewise.
* corelow.c (core_close): Likewise.
(core_close_cleanup): Remove parameter quitting from a caller.
* event-top.c (async_disconnect): Likewise.
* exec.c (exec_close_1): Remove parameter quitting.
* go32-nat.c (go32_close): Likewise.
* linux-nat.c (linux_nat_close): Remove parameter quitting. Remove
parameter quitting from a caller.
* mips-linux-nat.c (super_close): Remove parameter quitting from the
variable.
(mips_linux_close): Remove parameter quitting. Remove parameter
quitting from a caller.
* monitor.c (monitor_close): Remove parameter quitting.
* monitor.h (monitor_close): Likewise.
* record-btrace.c (record_btrace_close): Likewise.
* record-full.c (record_full_close): Likewise.
* remote-m32r-sdi.c (m32r_close): Remove parameter quitting and remove
it also from fprintf_unfiltered.
* remote-mips.c (mips_close): Remove parameter quitting.
(mips_detach): Remove parameter quitting from a caller.
* remote-sim.c (gdbsim_close): Remove parameter quitting.
(gdbsim_close): Remove duplicate function comment. Remove parameter
quitting and remove it also from printf_filtered.
* remote.c (remote_close): Remove parameter quitting.
* solib-svr4.c (enable_break): Remove parameter quitting from a caller.
* target.c (update_current_target): Remove parameter int from to_close
de_fault.
(push_target, unpush_target, pop_target): Remove parameter quitting from
a caller.
(pop_all_targets_above, pop_all_targets): Remove parameter quitting.
Remove parameter quitting from a caller.
(target_preopen): Remove parameter quitting from a caller.
(target_close): Remove parameter quitting. Remove parameter quitting
from a caller two times. Remove parameter quitting also from
fprintf_unfiltered.
* target.h (struct target_ops): Remove parameter quitting and as int
from fields to_xclose and to_close.
(extern struct target_ops current_target):
(target_close, pop_all_targets): Remove parameter quitting. Update the
comment.
(pop_all_targets_above): Remove parameter quitting.
* top.c (quit_target): Remove parameter quitting from a caller.
* tracepoint.c (tfile_close): Remove parameter quitting.
* windows-nat.c (windows_close): Remove parameter quitting.
2013-03-20 Corinna Vinschen <vinschen@redhat.com>
* windows-nat.c (handle_output_debug_string): Replace call

View File

@ -67,7 +67,7 @@ target_bfd_get_section_table (struct target_ops *ops)
}
static void
target_bfd_xclose (struct target_ops *t, int quitting)
target_bfd_xclose (struct target_ops *t)
{
struct target_bfd_data *data = t->to_data;

View File

@ -105,7 +105,7 @@ bsd_kvm_open (char *filename, int from_tty)
}
static void
bsd_kvm_close (int quitting)
bsd_kvm_close (void)
{
if (core_kd)
{

View File

@ -204,7 +204,7 @@ bsd_uthread_activate (struct objfile *objfile)
/* Cleanup due to deactivation. */
static void
bsd_uthread_close (int quitting)
bsd_uthread_close (void)
{
bsd_uthread_active = 0;
bsd_uthread_thread_run_addr = 0;

View File

@ -85,7 +85,7 @@ static void core_open (char *, int);
static void core_detach (struct target_ops *ops, char *, int);
static void core_close (int);
static void core_close (void);
static void core_close_cleanup (void *ignore);
@ -192,7 +192,7 @@ gdb_check_format (bfd *abfd)
stack spaces as empty. */
static void
core_close (int quitting)
core_close (void)
{
if (core_bfd)
{
@ -223,7 +223,7 @@ core_close (int quitting)
static void
core_close_cleanup (void *ignore)
{
core_close (0/*ignored*/);
core_close ();
}
/* Look for sections whose names start with `.reg/' so that we can

View File

@ -867,7 +867,7 @@ async_disconnect (gdb_client_data arg)
TRY_CATCH (exception, RETURN_MASK_ALL)
{
pop_all_targets (1);
pop_all_targets ();
}
signal (SIGHUP, SIG_DFL); /*FIXME: ??????????? */

View File

@ -115,7 +115,7 @@ exec_close (void)
sections and closes all executable bfds from all program spaces. */
static void
exec_close_1 (int quitting)
exec_close_1 (void)
{
struct vmap *vp, *nxt;

View File

@ -234,7 +234,7 @@ static int dr_ref_count[4];
static int prog_has_started = 0;
static void go32_open (char *name, int from_tty);
static void go32_close (int quitting);
static void go32_close (void);
static void go32_attach (struct target_ops *ops, char *args, int from_tty);
static void go32_detach (struct target_ops *ops, char *args, int from_tty);
static void go32_resume (struct target_ops *ops,
@ -370,7 +370,7 @@ go32_open (char *name, int from_tty)
}
static void
go32_close (int quitting)
go32_close (void)
{
}

View File

@ -5022,14 +5022,14 @@ linux_nat_stop (ptid_t ptid)
}
static void
linux_nat_close (int quitting)
linux_nat_close (void)
{
/* Unregister from the event loop. */
if (linux_nat_is_async_p ())
linux_nat_async (NULL, 0);
if (linux_ops->to_close)
linux_ops->to_close (quitting);
linux_ops->to_close ();
}
/* When requests are passed down from the linux-nat layer to the

View File

@ -60,7 +60,7 @@ static void (*super_fetch_registers) (struct target_ops *,
static void (*super_store_registers) (struct target_ops *,
struct regcache *, int);
static void (*super_close) (int);
static void (*super_close) (void);
/* Map gdb internal register number to ptrace ``address''.
These ``addresses'' are normally defined in <asm/ptrace.h>.
@ -1114,7 +1114,7 @@ mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
super implementation. */
static void
mips_linux_close (int quitting)
mips_linux_close (void)
{
struct mips_watchpoint *w;
struct mips_watchpoint *nw;
@ -1130,7 +1130,7 @@ mips_linux_close (int quitting)
current_watches = NULL;
if (super_close)
super_close (quitting);
super_close ();
}
void _initialize_mips_linux_nat (void);

View File

@ -853,7 +853,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
control. */
void
monitor_close (int quitting)
monitor_close (void)
{
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 (int quitting);
extern void monitor_close (void);
extern char *monitor_supply_register (struct regcache *regcache,
int regno, char *valstr);
extern int monitor_expect (char *prompt, char *buf, int buflen);

View File

@ -190,7 +190,7 @@ record_btrace_stop_recording (void)
/* The to_close method of target record-btrace. */
static void
record_btrace_close (int quitting)
record_btrace_close (void)
{
/* We already stopped recording. */
}

View File

@ -1021,7 +1021,7 @@ record_full_open (char *name, int from_tty)
/* "to_close" target method. Close the process record target. */
static void
record_full_close (int quitting)
record_full_close (void)
{
struct record_full_core_buf_entry *entry;

View File

@ -430,10 +430,10 @@ m32r_open (char *args, int from_tty)
/* Close out all files and local state before this target loses control. */
static void
m32r_close (int quitting)
m32r_close (void)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_close(%d)\n", quitting);
fprintf_unfiltered (gdb_stdlog, "m32r_close()\n");
if (sdi_desc)
{

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 (int quitting);
static void mips_close (void);
static void mips_detach (struct target_ops *ops, char *args, int from_tty);
@ -1723,7 +1723,7 @@ lsi_open (char *name, int from_tty)
/* Close a connection to the remote board. */
static void
mips_close (int quitting)
mips_close (void)
{
if (mips_is_open)
{
@ -1746,7 +1746,7 @@ mips_detach (struct target_ops *ops, char *args, int from_tty)
pop_target ();
mips_close (1);
mips_close ();
if (from_tty)
printf_unfiltered ("Ending remote MIPS debugging.\n");

View File

@ -78,7 +78,7 @@ static void gdbsim_load (char *prog, int fromtty);
static void gdbsim_open (char *args, int from_tty);
static void gdbsim_close (int quitting);
static void gdbsim_close (void);
static void gdbsim_detach (struct target_ops *ops, char *args, int from_tty);
@ -782,23 +782,16 @@ gdbsim_close_inferior (struct inferior *inf, void *arg)
return 0;
}
/* Does whatever cleanup is required for a target that we are no longer
going to be calling. Argument says whether we are quitting gdb and
should not get hung in case of errors, or whether we want a clean
termination even if it takes a while. This routine is automatically
always called just before a routine is popped off the target stack.
Closing file descriptors and freeing memory are typical things it should
do. */
/* Close out all files and local state before this target loses control. */
static void
gdbsim_close (int quitting)
gdbsim_close (void)
{
struct sim_inferior_data *sim_data
= get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
if (remote_debug)
printf_filtered ("gdbsim_close: quitting %d\n", quitting);
printf_filtered ("gdbsim_close\n");
iterate_over_inferiors (gdbsim_close_inferior, NULL);

View File

@ -108,7 +108,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 (int quitting);
static void remote_close (void);
static void remote_mourn (struct target_ops *ops);
@ -3001,7 +3001,7 @@ extended_remote_restart (void)
/* Clean up connection to a remote debugger. */
static void
remote_close (int quitting)
remote_close (void)
{
if (remote_desc == NULL)
return; /* already closed */

View File

@ -1675,7 +1675,7 @@ enable_break (struct svr4_info *info, int from_tty)
/* We're done with both the temporary bfd and target. Closing
the target closes the underlying bfd, because it holds the
only remaining reference. */
target_close (tmp_bfd_target, 0);
target_close (tmp_bfd_target);
if (sym_addr != 0)
{

View File

@ -738,7 +738,7 @@ update_current_target (void)
(void (*) (char *, int))
tcomplain);
de_fault (to_close,
(void (*) (int))
(void (*) (void))
target_ignore);
de_fault (to_post_attach,
(void (*) (int))
@ -1015,7 +1015,7 @@ push_target (struct target_ops *t)
(*cur) = (*cur)->beneath;
tmp->beneath = NULL;
target_close (tmp, 0);
target_close (tmp);
}
/* We have removed all targets in our stratum, now add the new one. */
@ -1062,7 +1062,7 @@ unpush_target (struct target_ops *t)
/* Finally close the target. Note we do this after unchaining, so
any target method calls from within the target_close
implementation don't end up in T anymore. */
target_close (t, 0);
target_close (t);
return 1;
}
@ -1070,7 +1070,7 @@ unpush_target (struct target_ops *t)
void
pop_target (void)
{
target_close (target_stack, 0); /* Let it clean up. */
target_close (target_stack); /* Let it clean up. */
if (unpush_target (target_stack) == 1)
return;
@ -1082,11 +1082,11 @@ pop_target (void)
}
void
pop_all_targets_above (enum strata above_stratum, int quitting)
pop_all_targets_above (enum strata above_stratum)
{
while ((int) (current_target.to_stratum) > (int) above_stratum)
{
target_close (target_stack, quitting);
target_close (target_stack);
if (!unpush_target (target_stack))
{
fprintf_unfiltered (gdb_stderr,
@ -1100,9 +1100,9 @@ pop_all_targets_above (enum strata above_stratum, int quitting)
}
void
pop_all_targets (int quitting)
pop_all_targets (void)
{
pop_all_targets_above (dummy_stratum, quitting);
pop_all_targets_above (dummy_stratum);
}
/* Return 1 if T is now pushed in the target stack. Return 0 otherwise. */
@ -2573,7 +2573,7 @@ target_preopen (int from_tty)
it doesn't (which seems like a win for UDI), remove it now. */
/* Leave the exec target, though. The user may be switching from a
live process to a core of the same program. */
pop_all_targets_above (file_stratum, 0);
pop_all_targets_above (file_stratum);
target_pre_inferior (from_tty);
}
@ -3775,15 +3775,15 @@ debug_to_open (char *args, int from_tty)
}
void
target_close (struct target_ops *targ, int quitting)
target_close (struct target_ops *targ)
{
if (targ->to_xclose != NULL)
targ->to_xclose (targ, quitting);
targ->to_xclose (targ);
else if (targ->to_close != NULL)
targ->to_close (quitting);
targ->to_close ();
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_close (%d)\n", quitting);
fprintf_unfiltered (gdb_stdlog, "target_close ()\n");
}
void

View File

@ -420,8 +420,8 @@ struct target_ops
/* Old targets with a static target vector provide "to_close".
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, int quitting);
void (*to_close) (int);
void (*to_xclose) (struct target_ops *targ);
void (*to_close) (void);
void (*to_attach) (struct target_ops *ops, char *, int);
void (*to_post_attach) (int);
void (*to_detach) (struct target_ops *ops, char *, int);
@ -959,15 +959,13 @@ extern struct target_ops current_target;
#define target_longname (current_target.to_longname)
/* Does whatever cleanup is required for a target that we are no
longer going to be calling. QUITTING indicates that GDB is exiting
and should not get hung on an error (otherwise it is important to
perform clean termination, even if it takes a while). This routine
is automatically always called after popping the target off the
target stack - the target's own methods are no longer available
through the target vector. Closing file descriptors and freeing all
memory allocated memory are typical things it should do. */
longer going to be calling. This routine is automatically always
called after popping the target off the target stack - the target's
own methods are no longer available through the target vector.
Closing file descriptors and freeing all memory allocated memory are
typical things it should do. */
void target_close (struct target_ops *targ, int quitting);
void target_close (struct target_ops *targ);
/* Attaches to a process on the target side. Arguments are as passed
to the `attach' command by the user. This routine can be called
@ -1858,16 +1856,12 @@ extern void target_preopen (int);
extern void pop_target (void);
/* Does whatever cleanup is required to get rid of all pushed targets.
QUITTING is propagated to target_close; it indicates that GDB is
exiting and should not get hung on an error (otherwise it is
important to perform clean termination, even if it takes a
while). */
extern void pop_all_targets (int quitting);
/* Does whatever cleanup is required to get rid of all pushed targets. */
extern void pop_all_targets (void);
/* Like pop_all_targets, but pops only targets whose stratum is
strictly above ABOVE_STRATUM. */
extern void pop_all_targets_above (enum strata above_stratum, int quitting);
extern void pop_all_targets_above (enum strata above_stratum);
extern int target_is_pushed (struct target_ops *t);

View File

@ -1295,7 +1295,7 @@ quit_target (void *arg)
/* Give all pushed targets a chance to do minimal cleanup, and pop
them all out. */
pop_all_targets (1);
pop_all_targets ();
/* Save the history information if it is appropriate to do so. */
if (write_history_p && history_filename)

View File

@ -4625,7 +4625,7 @@ parse_tsv_definition (char *line, struct uploaded_tsv **utsvp)
/* Close the trace file and generally clean up. */
static void
tfile_close (int quitting)
tfile_close (void)
{
int pid;

View File

@ -2367,7 +2367,7 @@ windows_can_run (void)
}
static void
windows_close (int x)
windows_close (void)
{
DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n",
PIDGET (inferior_ptid)));