GNU Binutils with patches for OS216
Révision | 67b538c17372e0b685852219e8de20f7ea1a56a2 (tree) |
---|---|
l'heure | 2006-09-16 07:50:12 |
Auteur | Nick Roberts <nickrob@snap...> |
Commiter | Nick Roberts |
* 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.
@@ -155,14 +155,8 @@ inf_ptrace_him (int pid) | ||
155 | 155 | if (target_can_async_p ()) |
156 | 156 | { |
157 | 157 | gdb_create_inferior (gdb_status, pid); |
158 | - | |
159 | 158 | gdb_signal_thread_create (&gdb_status->signal_status, pid); |
160 | - | |
161 | 159 | gdb_status->attached_in_ptrace = 1; |
162 | - gdb_status->stopped_in_ptrace = 0; | |
163 | - gdb_status->stopped_in_softexc = 0; | |
164 | - | |
165 | - gdb_status->suspend_count = 0; | |
166 | 160 | } |
167 | 161 | |
168 | 162 | /* START_INFERIOR_TRAPS_EXPECTED is defined in inferior.h, and will |
@@ -245,9 +239,6 @@ inf_ptrace_attach (char *args, int from_tty) | ||
245 | 239 | if (pid == getpid ()) /* Trying to masturbate? */ |
246 | 240 | error (_("I refuse to debug myself!")); |
247 | 241 | |
248 | - if (target_can_async_p ()) | |
249 | - gdb_inferior_destroy (gdb_status); | |
250 | - | |
251 | 242 | if (from_tty) |
252 | 243 | { |
253 | 244 | exec_file = get_exec_file (0); |
@@ -262,10 +253,6 @@ inf_ptrace_attach (char *args, int from_tty) | ||
262 | 253 | gdb_flush (gdb_stdout); |
263 | 254 | } |
264 | 255 | |
265 | - if (target_can_async_p ()) | |
266 | - gdb_create_inferior (gdb_status, pid); | |
267 | - | |
268 | - | |
269 | 256 | #ifdef PT_ATTACH |
270 | 257 | errno = 0; |
271 | 258 | ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3)0, 0); |
@@ -276,20 +263,14 @@ inf_ptrace_attach (char *args, int from_tty) | ||
276 | 263 | error (_("This system does not support attaching to a process")); |
277 | 264 | #endif |
278 | 265 | |
279 | - if (target_can_async_p ()) | |
280 | - { | |
281 | - gdb_status->attached_in_ptrace = 1; | |
282 | - gdb_status->stopped_in_ptrace = 0; | |
283 | - gdb_status->stopped_in_softexc = 0; | |
284 | - | |
285 | - gdb_status->suspend_count = 0; | |
286 | - } | |
287 | - | |
288 | 266 | inferior_ptid = pid_to_ptid (pid); |
289 | 267 | push_target (ptrace_ops_hack); |
290 | 268 | |
291 | - if (target_can_async_p () && gdb_status->attached_in_ptrace) | |
269 | + if (target_can_async_p ()) | |
292 | 270 | { |
271 | + gdb_create_inferior (gdb_status, pid); | |
272 | + gdb_status->attached_in_ptrace = 1; | |
273 | + gdb_status->stopped_in_ptrace = 0; | |
293 | 274 | gdb_signal_thread_create (&gdb_status->signal_status, pid); |
294 | 275 | stop_soon = STOP_QUIETLY; |
295 | 276 | wait_for_inferior (); |
@@ -348,6 +329,9 @@ inf_ptrace_detach (char *args, int from_tty) | ||
348 | 329 | error (_("This system does not support detaching from a process")); |
349 | 330 | #endif |
350 | 331 | |
332 | + if (target_can_async_p ()) | |
333 | + gdb_inferior_destroy (gdb_status); | |
334 | + | |
351 | 335 | inferior_ptid = null_ptid; |
352 | 336 | unpush_target (ptrace_ops_hack); |
353 | 337 | } |