diff options
author | Nick Roberts <nickrob@snap.net.nz> | 2006-09-15 22:50:12 +0000 |
---|---|---|
committer | Nick Roberts <nickrob@snap.net.nz> | 2006-09-15 22:50:12 +0000 |
commit | 01aec80370360b2fc1c0572f8765adfc6d4048d2 (patch) | |
tree | 5a9c5c8f16717497ac260e86627adf04d5fd7237 /gdb | |
parent | 94ef92a61ba9f39273d31c4f8c1e8afb46fd1b68 (diff) | |
download | gdb-01aec80370360b2fc1c0572f8765adfc6d4048d2.tar.gz |
* async-nat-inferior.h (struct gdb_inferior_status): Remove
unused members.
(inf_ptrace_him): Don't set above deleted members.
(inf_ptrace_attach): Don't call gdb_inferior_destroy as it
is called by gdb_create_inferior later. Merge async conditionals.
(inf_ptrace_detach): Delete signal thread.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/inf-ptrace.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index cbee144cc77..a41e40540cd 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -155,14 +155,8 @@ inf_ptrace_him (int pid) if (target_can_async_p ()) { gdb_create_inferior (gdb_status, pid); - gdb_signal_thread_create (&gdb_status->signal_status, pid); - gdb_status->attached_in_ptrace = 1; - gdb_status->stopped_in_ptrace = 0; - gdb_status->stopped_in_softexc = 0; - - gdb_status->suspend_count = 0; } /* START_INFERIOR_TRAPS_EXPECTED is defined in inferior.h, and will @@ -245,9 +239,6 @@ inf_ptrace_attach (char *args, int from_tty) if (pid == getpid ()) /* Trying to masturbate? */ error (_("I refuse to debug myself!")); - if (target_can_async_p ()) - gdb_inferior_destroy (gdb_status); - if (from_tty) { exec_file = get_exec_file (0); @@ -262,10 +253,6 @@ inf_ptrace_attach (char *args, int from_tty) gdb_flush (gdb_stdout); } - if (target_can_async_p ()) - gdb_create_inferior (gdb_status, pid); - - #ifdef PT_ATTACH errno = 0; ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3)0, 0); @@ -276,20 +263,14 @@ inf_ptrace_attach (char *args, int from_tty) error (_("This system does not support attaching to a process")); #endif - if (target_can_async_p ()) - { - gdb_status->attached_in_ptrace = 1; - gdb_status->stopped_in_ptrace = 0; - gdb_status->stopped_in_softexc = 0; - - gdb_status->suspend_count = 0; - } - inferior_ptid = pid_to_ptid (pid); push_target (ptrace_ops_hack); - if (target_can_async_p () && gdb_status->attached_in_ptrace) + if (target_can_async_p ()) { + gdb_create_inferior (gdb_status, pid); + gdb_status->attached_in_ptrace = 1; + gdb_status->stopped_in_ptrace = 0; gdb_signal_thread_create (&gdb_status->signal_status, pid); stop_soon = STOP_QUIETLY; wait_for_inferior (); @@ -348,6 +329,9 @@ inf_ptrace_detach (char *args, int from_tty) error (_("This system does not support detaching from a process")); #endif + if (target_can_async_p ()) + gdb_inferior_destroy (gdb_status); + inferior_ptid = null_ptid; unpush_target (ptrace_ops_hack); } |