diff options
author | Pedro Alves <palves@redhat.com> | 2008-09-22 15:21:30 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-09-22 15:21:30 +0000 |
commit | 181e7f9393edb01de72d25e208a6ef4f069fb36f (patch) | |
tree | 1e6c460894d9f33dbfafd225515cabefc66f8523 /gdb/remote.c | |
parent | d6b48e9c8beee5d3ab78ac1979f6af0d6de9ae30 (diff) | |
download | gdb-181e7f9393edb01de72d25e208a6ef4f069fb36f.zip gdb-181e7f9393edb01de72d25e208a6ef4f069fb36f.tar.gz gdb-181e7f9393edb01de72d25e208a6ef4f069fb36f.tar.bz2 |
Remove the attach_flag global, and make it per-inferior.
* inferior.h (attach_flag): Delete.
(inferior_process): Declare.
* solib.c (update_solib_list): Adjust.
* gnu-nat.c (gnu_create_inferior, gnu_attach): Adjust.
* inf-ptrace.c (inf_ptrace_detach): Adjust.
(inf_ptrace_files_info): Get it from the current inferior.
* inf-ttrace.c (inf_ttrace_attach): Adjust.
(inf_ttrace_files_info): Get it from the current
inferior.
* inflow.c (terminal_inferior, terminal_ours_1, set_sigint_trap)
(clear_sigint_trap): Get it from the current process.
* remote.c (extended_remote_attach_1)
(extended_remote_create_inferior_1): Adjust.
* top.c (quit_confirm, quit_target): Get it from the current inferior.
* procfs.c (do_detach): Adjust.
(procfs_wait): Get it from the event inferior.
(procfs_files_info): Get it from the current inferior.
* nto-procfs.c (procfs_files_info): Likewise.
(procfs_attach): Adjust. Set the attach_flag here.
(do_attach): Don't set it here.
(procfs_detach): Don't clear it.
(procfs_mourn_inferior): Don't clear it.
* solib-osf.c (osf_solib_create_inferior_hook): Adjust.
* target.c (attach_flag): Delete.
(generic_mourn_inferior): Don't clear it.
* win32-nat.c (get_win32_debug_event): Get it from the event
process.
(do_initial_win32_stuff): Add attaching argument. Set attach_flag
in the inferior accordingly.
(win32_attach): Don't set the attach_flag here. Pass 1 to
do_intial_win32_stuff.
(win32_files_info): Get it from the current inferior.
(win32_create_inferior): Dont clear attach_flag here. Pass 0 to
do_intial_win32_stuff.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index dfae2f6..9dacd17 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3074,6 +3074,7 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty) int pid; char *dummy; char *wait_status = NULL; + struct inferior *inf; if (!args) error_no_arg (_("process-id to attach")); @@ -3113,13 +3114,12 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty) /* Now, if we have thread information, update inferior_ptid. */ inferior_ptid = remote_current_thread (inferior_ptid); - add_inferior (pid); + inf = add_inferior (pid); + inf->attach_flag = 1; /* Now, add the main thread to the thread list. */ add_thread_silent (inferior_ptid); - attach_flag = 1; - /* Next, if the target can specify a description, read it. We do this before anything involving memory or registers. */ target_find_description (); @@ -5624,7 +5624,6 @@ extended_remote_create_inferior_1 (char *exec_file, char *args, init_wait_for_inferior (); /* Now mark the inferior as running before we do anything else. */ - attach_flag = 0; inferior_ptid = magic_null_ptid; add_inferior (ptid_get_pid (inferior_ptid)); |