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 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
}
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;
}
static void
-bsd_kvm_close (int quitting)
+bsd_kvm_close (void)
{
if (core_kd)
{
/* 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;
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);
stack spaces as empty. */
static void
-core_close (int quitting)
+core_close (void)
{
if (core_bfd)
{
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
TRY_CATCH (exception, RETURN_MASK_ALL)
{
- pop_all_targets (1);
+ pop_all_targets ();
}
signal (SIGHUP, SIG_DFL); /*FIXME: ??????????? */
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;
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,
}
static void
-go32_close (int quitting)
+go32_close (void)
{
}
}
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
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>.
super implementation. */
static void
-mips_linux_close (int quitting)
+mips_linux_close (void)
{
struct mips_watchpoint *w;
struct mips_watchpoint *nw;
current_watches = NULL;
if (super_close)
- super_close (quitting);
+ super_close ();
}
void _initialize_mips_linux_nat (void);
control. */
void
-monitor_close (int quitting)
+monitor_close (void)
{
if (monitor_desc)
serial_close (monitor_desc);
#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);
/* The to_close method of target record-btrace. */
static void
-record_btrace_close (int quitting)
+record_btrace_close (void)
{
/* We already stopped recording. */
}
/* "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;
/* 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)
{
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);
/* Close a connection to the remote board. */
static void
-mips_close (int quitting)
+mips_close (void)
{
if (mips_is_open)
{
pop_target ();
- mips_close (1);
+ mips_close ();
if (from_tty)
printf_unfiltered ("Ending remote MIPS debugging.\n");
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);
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);
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);
/* Clean up connection to a remote debugger. */
static void
-remote_close (int quitting)
+remote_close (void)
{
if (remote_desc == NULL)
return; /* already closed */
/* 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)
{
(void (*) (char *, int))
tcomplain);
de_fault (to_close,
- (void (*) (int))
+ (void (*) (void))
target_ignore);
de_fault (to_post_attach,
(void (*) (int))
(*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. */
/* 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;
}
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;
}
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,
}
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. */
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);
}
}
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
/* 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);
#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
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);
/* 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)
/* Close the trace file and generally clean up. */
static void
-tfile_close (int quitting)
+tfile_close (void)
{
int pid;
}
static void
-windows_close (int x)
+windows_close (void)
{
DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n",
PIDGET (inferior_ptid)));