Pass inferior down to target_detach and to_detach
The to_detach target_ops method implementations are currently expected to work on current_inferior/inferior_ptid. In order to make things more explicit, and remove some "shadow" parameter passing through globals, this patch adds an "inferior" parameter to to_detach. Implementations will be expected to use this instead of relying on the global. However, to keep things simple, this patch only does the minimum that is necessary to add the parameter. The following patch gives an example of how one such implementation would be adapted. If the approach is deemed good, we can then look into adapting more implementations. Until then, they'll continue to work as they do currently. gdb/ChangeLog: * target.h (struct target_ops) <to_detach>: Add inferior parameter. (target_detach): Likewise. * target.c (dispose_inferior): Pass inferior down. (target_detach): Pass inferior down. Assert that it is equal to the current inferior. * aix-thread.c (aix_thread_detach): Pass inferior down. * corefile.c (core_file_command): Pass current_inferior() down. * corelow.c (core_detach): Add inferior parameter. * darwin-nat.c (darwin_detach): Likewise. * gnu-nat.c (gnu_detach): Likewise. * inf-ptrace.c (inf_ptrace_detach): Likewise. * infcmd.c (detach_command): Pass current_inferior() down to target_detach. * infrun.c (follow_fork_inferior): Pass parent_inf to target_detach. (handle_vfork_child_exec_or_exit): Pass inf->vfork_parent to target_detach. * linux-nat.c (linux_nat_detach): Add inferior parameter. * linux-thread-db.c (thread_db_detach): Likewise. * nto-procfs.c (procfs_detach): Likewise. * procfs.c (procfs_detach): Likewise. * record.c (record_detach): Likewise. * record.h (struct inferior): Forward-declare. (record_detach): Add inferior parameter. * remote-sim.c (gdbsim_detach): Likewise. * remote.c (remote_detach_1): Likewise. (remote_detach): Likewise. (extended_remote_detach): Likewise. * sol-thread.c (sol_thread_detach): Likewise. * target-debug.h (target_debug_print_inferior_p): New macro. * target-delegates.c: Re-generate. * top.c (kill_or_detach): Pass inferior down to target_detach. * windows-nat.c (windows_detach): Add inferior parameter.
This commit is contained in:
parent
6bd6f3b656
commit
6e1e1966ba
24 changed files with 89 additions and 41 deletions
|
@ -1,3 +1,40 @@
|
||||||
|
2018-01-19 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
|
* target.h (struct target_ops) <to_detach>: Add inferior
|
||||||
|
parameter.
|
||||||
|
(target_detach): Likewise.
|
||||||
|
* target.c (dispose_inferior): Pass inferior down.
|
||||||
|
(target_detach): Pass inferior down. Assert that it is equal to
|
||||||
|
the current inferior.
|
||||||
|
* aix-thread.c (aix_thread_detach): Pass inferior down.
|
||||||
|
* corefile.c (core_file_command): Pass current_inferior() down.
|
||||||
|
* corelow.c (core_detach): Add inferior parameter.
|
||||||
|
* darwin-nat.c (darwin_detach): Likewise.
|
||||||
|
* gnu-nat.c (gnu_detach): Likewise.
|
||||||
|
* inf-ptrace.c (inf_ptrace_detach): Likewise.
|
||||||
|
* infcmd.c (detach_command): Pass current_inferior() down to
|
||||||
|
target_detach.
|
||||||
|
* infrun.c (follow_fork_inferior): Pass parent_inf to
|
||||||
|
target_detach.
|
||||||
|
(handle_vfork_child_exec_or_exit): Pass inf->vfork_parent to
|
||||||
|
target_detach.
|
||||||
|
* linux-nat.c (linux_nat_detach): Add inferior parameter.
|
||||||
|
* linux-thread-db.c (thread_db_detach): Likewise.
|
||||||
|
* nto-procfs.c (procfs_detach): Likewise.
|
||||||
|
* procfs.c (procfs_detach): Likewise.
|
||||||
|
* record.c (record_detach): Likewise.
|
||||||
|
* record.h (struct inferior): Forward-declare.
|
||||||
|
(record_detach): Add inferior parameter.
|
||||||
|
* remote-sim.c (gdbsim_detach): Likewise.
|
||||||
|
* remote.c (remote_detach_1): Likewise.
|
||||||
|
(remote_detach): Likewise.
|
||||||
|
(extended_remote_detach): Likewise.
|
||||||
|
* sol-thread.c (sol_thread_detach): Likewise.
|
||||||
|
* target-debug.h (target_debug_print_inferior_p): New macro.
|
||||||
|
* target-delegates.c: Re-generate.
|
||||||
|
* top.c (kill_or_detach): Pass inferior down to target_detach.
|
||||||
|
* windows-nat.c (windows_detach): Add inferior parameter.
|
||||||
|
|
||||||
2018-01-19 Simon Marchi <simon.marchi@ericsson.com>
|
2018-01-19 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
* target.h (struct target_ops) <to_detach>: Remove args
|
* target.h (struct target_ops) <to_detach>: Remove args
|
||||||
|
|
|
@ -981,12 +981,12 @@ aix_thread_inferior_created (struct target_ops *ops, int from_tty)
|
||||||
/* Detach from the process attached to by aix_thread_attach(). */
|
/* Detach from the process attached to by aix_thread_attach(). */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
aix_thread_detach (struct target_ops *ops, int from_tty)
|
aix_thread_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
struct target_ops *beneath = find_target_beneath (ops);
|
struct target_ops *beneath = find_target_beneath (ops);
|
||||||
|
|
||||||
pd_disable ();
|
pd_disable ();
|
||||||
beneath->to_detach (beneath, from_tty);
|
beneath->to_detach (beneath, inf, from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tell the inferior process to continue running thread PID if != -1
|
/* Tell the inferior process to continue running thread PID if != -1
|
||||||
|
|
|
@ -68,7 +68,7 @@ core_file_command (const char *filename, int from_tty)
|
||||||
gdb_assert (core_target != NULL);
|
gdb_assert (core_target != NULL);
|
||||||
|
|
||||||
if (!filename)
|
if (!filename)
|
||||||
(core_target->to_detach) (core_target, from_tty);
|
(core_target->to_detach) (core_target, current_inferior (), from_tty);
|
||||||
else
|
else
|
||||||
(core_target->to_open) (filename, from_tty);
|
(core_target->to_open) (filename, from_tty);
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,7 +464,7 @@ core_open (const char *arg, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
core_detach (struct target_ops *ops, int from_tty)
|
core_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
unpush_target (ops);
|
unpush_target (ops);
|
||||||
reinit_frame_cache ();
|
reinit_frame_cache ();
|
||||||
|
|
|
@ -1938,10 +1938,9 @@ darwin_attach (struct target_ops *ops, const char *args, int from_tty)
|
||||||
previously attached. It *might* work if the program was
|
previously attached. It *might* work if the program was
|
||||||
started via fork. */
|
started via fork. */
|
||||||
static void
|
static void
|
||||||
darwin_detach (struct target_ops *ops, int from_tty)
|
darwin_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
pid_t pid = ptid_get_pid (inferior_ptid);
|
pid_t pid = ptid_get_pid (inferior_ptid);
|
||||||
struct inferior *inf = current_inferior ();
|
|
||||||
darwin_inferior *priv = get_darwin_inferior (inf);
|
darwin_inferior *priv = get_darwin_inferior (inf);
|
||||||
kern_return_t kret;
|
kern_return_t kret;
|
||||||
int res;
|
int res;
|
||||||
|
|
|
@ -2255,7 +2255,7 @@ gnu_attach (struct target_ops *ops, const char *args, int from_tty)
|
||||||
previously attached. It *might* work if the program was
|
previously attached. It *might* work if the program was
|
||||||
started via fork. */
|
started via fork. */
|
||||||
static void
|
static void
|
||||||
gnu_detach (struct target_ops *ops, int from_tty)
|
gnu_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
int pid;
|
int pid;
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ inf_ptrace_post_attach (struct target_ops *self, int pid)
|
||||||
/* Detach from the inferior. If FROM_TTY is non-zero, be chatty about it. */
|
/* Detach from the inferior. If FROM_TTY is non-zero, be chatty about it. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
inf_ptrace_detach (struct target_ops *ops, int from_tty)
|
inf_ptrace_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
pid_t pid = ptid_get_pid (inferior_ptid);
|
pid_t pid = ptid_get_pid (inferior_ptid);
|
||||||
|
|
||||||
|
|
|
@ -2976,7 +2976,7 @@ detach_command (const char *args, int from_tty)
|
||||||
|
|
||||||
disconnect_tracing ();
|
disconnect_tracing ();
|
||||||
|
|
||||||
target_detach (from_tty);
|
target_detach (current_inferior (), from_tty);
|
||||||
|
|
||||||
/* The current inferior process was just detached successfully. Get
|
/* The current inferior process was just detached successfully. Get
|
||||||
rid of breakpoints that no longer make sense. Note we don't do
|
rid of breakpoints that no longer make sense. Note we don't do
|
||||||
|
|
|
@ -606,7 +606,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||||
target_pid_to_str (process_ptid));
|
target_pid_to_str (process_ptid));
|
||||||
}
|
}
|
||||||
|
|
||||||
target_detach (0);
|
target_detach (parent_inf, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note that the detach above makes PARENT_INF dangling. */
|
/* Note that the detach above makes PARENT_INF dangling. */
|
||||||
|
@ -976,7 +976,7 @@ handle_vfork_child_exec_or_exit (int exec)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target_detach (0);
|
target_detach (inf->vfork_parent, 0);
|
||||||
|
|
||||||
/* Put it back. */
|
/* Put it back. */
|
||||||
inf->pspace = pspace;
|
inf->pspace = pspace;
|
||||||
|
|
|
@ -1497,7 +1497,7 @@ detach_callback (struct lwp_info *lp, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linux_nat_detach (struct target_ops *ops, int from_tty)
|
linux_nat_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
int pid;
|
int pid;
|
||||||
struct lwp_info *main_lwp;
|
struct lwp_info *main_lwp;
|
||||||
|
|
|
@ -1090,13 +1090,13 @@ record_thread (struct thread_db_info *info,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
thread_db_detach (struct target_ops *ops, int from_tty)
|
thread_db_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
struct target_ops *target_beneath = find_target_beneath (ops);
|
struct target_ops *target_beneath = find_target_beneath (ops);
|
||||||
|
|
||||||
delete_thread_db_info (ptid_get_pid (inferior_ptid));
|
delete_thread_db_info (ptid_get_pid (inferior_ptid));
|
||||||
|
|
||||||
target_beneath->to_detach (target_beneath, from_tty);
|
target_beneath->to_detach (target_beneath, inf, from_tty);
|
||||||
|
|
||||||
/* NOTE: From this point on, inferior_ptid is null_ptid. */
|
/* NOTE: From this point on, inferior_ptid is null_ptid. */
|
||||||
|
|
||||||
|
|
|
@ -943,7 +943,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
|
||||||
on signals, etc. We'd better not have left any breakpoints
|
on signals, etc. We'd better not have left any breakpoints
|
||||||
in the program or it'll die when it hits one. */
|
in the program or it'll die when it hits one. */
|
||||||
static void
|
static void
|
||||||
procfs_detach (struct target_ops *ops, int from_tty)
|
procfs_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
int pid;
|
int pid;
|
||||||
|
|
||||||
|
|
|
@ -1924,7 +1924,7 @@ procfs_attach (struct target_ops *ops, const char *args, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
procfs_detach (struct target_ops *ops, int from_tty)
|
procfs_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
int pid = ptid_get_pid (inferior_ptid);
|
int pid = ptid_get_pid (inferior_ptid);
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ record_disconnect (struct target_ops *t, const char *args, int from_tty)
|
||||||
/* See record.h. */
|
/* See record.h. */
|
||||||
|
|
||||||
void
|
void
|
||||||
record_detach (struct target_ops *t, int from_tty)
|
record_detach (struct target_ops *t, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
gdb_assert (t->to_stratum == record_stratum);
|
gdb_assert (t->to_stratum == record_stratum);
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ record_detach (struct target_ops *t, int from_tty)
|
||||||
record_stop (t);
|
record_stop (t);
|
||||||
record_unpush (t);
|
record_unpush (t);
|
||||||
|
|
||||||
target_detach (from_tty);
|
target_detach (inf, from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See record.h. */
|
/* See record.h. */
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "common/enum-flags.h"
|
#include "common/enum-flags.h"
|
||||||
|
|
||||||
struct cmd_list_element;
|
struct cmd_list_element;
|
||||||
|
struct inferior;
|
||||||
|
|
||||||
extern unsigned int record_debug;
|
extern unsigned int record_debug;
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ extern void record_goto (const char *arg);
|
||||||
extern void record_disconnect (struct target_ops *, const char *, int);
|
extern void record_disconnect (struct target_ops *, const char *, int);
|
||||||
|
|
||||||
/* The default "to_detach" target method for record targets. */
|
/* The default "to_detach" target method for record targets. */
|
||||||
extern void record_detach (struct target_ops *, int);
|
extern void record_detach (struct target_ops *, inferior *, int);
|
||||||
|
|
||||||
/* The default "to_mourn_inferior" target method for record targets. */
|
/* The default "to_mourn_inferior" target method for record targets. */
|
||||||
extern void record_mourn_inferior (struct target_ops *);
|
extern void record_mourn_inferior (struct target_ops *);
|
||||||
|
|
|
@ -77,7 +77,7 @@ static void gdbsim_open (const char *args, int from_tty);
|
||||||
|
|
||||||
static void gdbsim_close (struct target_ops *self);
|
static void gdbsim_close (struct target_ops *self);
|
||||||
|
|
||||||
static void gdbsim_detach (struct target_ops *ops, int from_tty);
|
static void gdbsim_detach (struct target_ops *ops, inferior *inf, int from_tty);
|
||||||
|
|
||||||
static void gdbsim_prepare_to_store (struct target_ops *self,
|
static void gdbsim_prepare_to_store (struct target_ops *self,
|
||||||
struct regcache *regcache);
|
struct regcache *regcache);
|
||||||
|
@ -820,7 +820,7 @@ gdbsim_close (struct target_ops *self)
|
||||||
Use this when you want to detach and do something else with your gdb. */
|
Use this when you want to detach and do something else with your gdb. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdbsim_detach (struct target_ops *ops, int from_tty)
|
gdbsim_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
if (remote_debug)
|
if (remote_debug)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbsim_detach\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbsim_detach\n");
|
||||||
|
|
10
gdb/remote.c
10
gdb/remote.c
|
@ -5126,7 +5126,7 @@ remote_detach_pid (int pid)
|
||||||
one. */
|
one. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remote_detach_1 (int from_tty)
|
remote_detach_1 (int from_tty, inferior *inf)
|
||||||
{
|
{
|
||||||
int pid = ptid_get_pid (inferior_ptid);
|
int pid = ptid_get_pid (inferior_ptid);
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
|
@ -5162,15 +5162,15 @@ remote_detach_1 (int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remote_detach (struct target_ops *ops, int from_tty)
|
remote_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
remote_detach_1 (from_tty);
|
remote_detach_1 (from_tty, inf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
extended_remote_detach (struct target_ops *ops, int from_tty)
|
extended_remote_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
remote_detach_1 (from_tty);
|
remote_detach_1 (from_tty, inf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Target follow-fork function for remote targets. On entry, and
|
/* Target follow-fork function for remote targets. On entry, and
|
||||||
|
|
|
@ -348,14 +348,14 @@ lwp_to_thread (ptid_t lwp)
|
||||||
program was started via the normal ptrace (PTRACE_TRACEME). */
|
program was started via the normal ptrace (PTRACE_TRACEME). */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sol_thread_detach (struct target_ops *ops, int from_tty)
|
sol_thread_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
struct target_ops *beneath = find_target_beneath (ops);
|
struct target_ops *beneath = find_target_beneath (ops);
|
||||||
|
|
||||||
sol_thread_active = 0;
|
sol_thread_active = 0;
|
||||||
inferior_ptid = pid_to_ptid (ptid_get_pid (main_ph.ptid));
|
inferior_ptid = pid_to_ptid (ptid_get_pid (main_ph.ptid));
|
||||||
unpush_target (ops);
|
unpush_target (ops);
|
||||||
beneath->to_detach (beneath, from_tty);
|
beneath->to_detach (beneath, inf, from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resume execution of process PTID. If STEP is nozero, then just
|
/* Resume execution of process PTID. If STEP is nozero, then just
|
||||||
|
|
|
@ -170,6 +170,8 @@
|
||||||
target_debug_do_print (host_address_to_string (X.get ()))
|
target_debug_do_print (host_address_to_string (X.get ()))
|
||||||
#define target_debug_print_gdb_array_view_const_int(X) \
|
#define target_debug_print_gdb_array_view_const_int(X) \
|
||||||
target_debug_do_print (host_address_to_string (X.data ()))
|
target_debug_do_print (host_address_to_string (X.data ()))
|
||||||
|
#define target_debug_print_inferior_p(inf) \
|
||||||
|
target_debug_do_print (host_address_to_string (inf))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
|
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
|
||||||
|
|
|
@ -28,26 +28,28 @@ debug_post_attach (struct target_ops *self, int arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
delegate_detach (struct target_ops *self, int arg1)
|
delegate_detach (struct target_ops *self, inferior *arg1, int arg2)
|
||||||
{
|
{
|
||||||
self = self->beneath;
|
self = self->beneath;
|
||||||
self->to_detach (self, arg1);
|
self->to_detach (self, arg1, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tdefault_detach (struct target_ops *self, int arg1)
|
tdefault_detach (struct target_ops *self, inferior *arg1, int arg2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
debug_detach (struct target_ops *self, int arg1)
|
debug_detach (struct target_ops *self, inferior *arg1, int arg2)
|
||||||
{
|
{
|
||||||
fprintf_unfiltered (gdb_stdlog, "-> %s->to_detach (...)\n", debug_target.to_shortname);
|
fprintf_unfiltered (gdb_stdlog, "-> %s->to_detach (...)\n", debug_target.to_shortname);
|
||||||
debug_target.to_detach (&debug_target, arg1);
|
debug_target.to_detach (&debug_target, arg1, arg2);
|
||||||
fprintf_unfiltered (gdb_stdlog, "<- %s->to_detach (", debug_target.to_shortname);
|
fprintf_unfiltered (gdb_stdlog, "<- %s->to_detach (", debug_target.to_shortname);
|
||||||
target_debug_print_struct_target_ops_p (&debug_target);
|
target_debug_print_struct_target_ops_p (&debug_target);
|
||||||
fputs_unfiltered (", ", gdb_stdlog);
|
fputs_unfiltered (", ", gdb_stdlog);
|
||||||
target_debug_print_int (arg1);
|
target_debug_print_inferior_p (arg1);
|
||||||
|
fputs_unfiltered (", ", gdb_stdlog);
|
||||||
|
target_debug_print_int (arg2);
|
||||||
fputs_unfiltered (")\n", gdb_stdlog);
|
fputs_unfiltered (")\n", gdb_stdlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
gdb/target.c
13
gdb/target.c
|
@ -2108,7 +2108,7 @@ dispose_inferior (struct inferior *inf, void *args)
|
||||||
if (target_has_execution)
|
if (target_has_execution)
|
||||||
target_kill ();
|
target_kill ();
|
||||||
else
|
else
|
||||||
target_detach (0);
|
target_detach (inf, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2144,8 +2144,15 @@ target_preopen (int from_tty)
|
||||||
/* See target.h. */
|
/* See target.h. */
|
||||||
|
|
||||||
void
|
void
|
||||||
target_detach (int from_tty)
|
target_detach (inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
|
/* As long as some to_detach implementations rely on the current_inferior
|
||||||
|
(either directly, or indirectly, like through target_gdbarch or by
|
||||||
|
reading memory), INF needs to be the current inferior. When that
|
||||||
|
requirement will become no longer true, then we can remove this
|
||||||
|
assertion. */
|
||||||
|
gdb_assert (inf == current_inferior ());
|
||||||
|
|
||||||
if (gdbarch_has_global_breakpoints (target_gdbarch ()))
|
if (gdbarch_has_global_breakpoints (target_gdbarch ()))
|
||||||
/* Don't remove global breakpoints here. They're removed on
|
/* Don't remove global breakpoints here. They're removed on
|
||||||
disconnection from the target. */
|
disconnection from the target. */
|
||||||
|
@ -2157,7 +2164,7 @@ target_detach (int from_tty)
|
||||||
|
|
||||||
prepare_for_detach ();
|
prepare_for_detach ();
|
||||||
|
|
||||||
current_target.to_detach (¤t_target, from_tty);
|
current_target.to_detach (¤t_target, inf, from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -440,7 +440,7 @@ struct target_ops
|
||||||
void (*to_attach) (struct target_ops *ops, const char *, int);
|
void (*to_attach) (struct target_ops *ops, const char *, int);
|
||||||
void (*to_post_attach) (struct target_ops *, int)
|
void (*to_post_attach) (struct target_ops *, int)
|
||||||
TARGET_DEFAULT_IGNORE ();
|
TARGET_DEFAULT_IGNORE ();
|
||||||
void (*to_detach) (struct target_ops *ops, int)
|
void (*to_detach) (struct target_ops *ops, inferior *, int)
|
||||||
TARGET_DEFAULT_IGNORE ();
|
TARGET_DEFAULT_IGNORE ();
|
||||||
void (*to_disconnect) (struct target_ops *, const char *, int)
|
void (*to_disconnect) (struct target_ops *, const char *, int)
|
||||||
TARGET_DEFAULT_NORETURN (tcomplain ());
|
TARGET_DEFAULT_NORETURN (tcomplain ());
|
||||||
|
@ -1326,7 +1326,7 @@ extern void target_announce_detach (int from_tty);
|
||||||
in the program or it'll die when it hits one. FROM_TTY says whether to be
|
in the program or it'll die when it hits one. FROM_TTY says whether to be
|
||||||
verbose or not. */
|
verbose or not. */
|
||||||
|
|
||||||
extern void target_detach (int from_tty);
|
extern void target_detach (inferior *inf, int from_tty);
|
||||||
|
|
||||||
/* Disconnect from the current target without resuming it (leaving it
|
/* Disconnect from the current target without resuming it (leaving it
|
||||||
waiting for a debugger). */
|
waiting for a debugger). */
|
||||||
|
|
|
@ -1485,7 +1485,7 @@ kill_or_detach (struct inferior *inf, void *args)
|
||||||
if (target_has_execution)
|
if (target_has_execution)
|
||||||
{
|
{
|
||||||
if (inf->attach_flag)
|
if (inf->attach_flag)
|
||||||
target_detach (qt->from_tty);
|
target_detach (inf, qt->from_tty);
|
||||||
else
|
else
|
||||||
target_kill ();
|
target_kill ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1931,7 +1931,7 @@ windows_attach (struct target_ops *ops, const char *args, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
windows_detach (struct target_ops *ops, int from_tty)
|
windows_detach (struct target_ops *ops, inferior *inf, int from_tty)
|
||||||
{
|
{
|
||||||
int detached = 1;
|
int detached = 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue