* breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
[deliverable/binutils-gdb.git] / gdb / inftarg.c
index d40d55a7b009507c14b3d3cf0a441262fdcdd9a1..e357c0ebbe62779b62b00dc4628587a2566e15f1 100644 (file)
@@ -1,5 +1,4 @@
-/* This file inplements the host independent child process statum.
-
+/* Target-vector operations for controlling Unix child processes, for GDB.
    Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
@@ -61,6 +60,9 @@ child_create_inferior PARAMS ((char *, char *, char **));
 static void
 child_mourn_inferior PARAMS ((void));
 
+static int
+child_can_run PARAMS ((void));
+
 extern char **environ;
 
 /* Forward declaration */
@@ -92,8 +94,7 @@ child_wait (status)
 }
 
 
-/* Attach to process PID, then initialize for debugging it
-   and wait for the trace-trap that results from attaching.  */
+/* Attach to process PID, then initialize for debugging it.  */
 
 static void
 child_attach (args, from_tty)
@@ -103,8 +104,6 @@ child_attach (args, from_tty)
   char *exec_file;
   int pid;
 
-  dont_repeat();
-
   if (!args)
     error_no_arg ("process-id to attach");
 
@@ -116,14 +115,6 @@ child_attach (args, from_tty)
   if (pid == getpid())         /* Trying to masturbate? */
     error ("I refuse to debug myself!");
 
-  if (target_has_execution)
-    {
-      if (query ("A program is being debugged already.  Kill it? "))
-       target_kill ();
-      else
-       error ("Inferior not killed.");
-    }
-
   if (from_tty)
     {
       exec_file = (char *) get_exec_file (0);
@@ -139,31 +130,17 @@ child_attach (args, from_tty)
   attach (pid);
   inferior_pid = pid;
   push_target (&child_ops);
-
-  mark_breakpoints_out ();
-  target_terminal_init ();
-  clear_proceed_status ();
-  stop_soon_quietly = 1;
-  /*proceed (-1, 0, -2);*/
-  target_terminal_inferior ();
-  wait_for_inferior ();
-#ifdef SOLIB_ADD
-  SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
-#endif
-  normal_stop ();
 #endif  /* ATTACH_DETACH */
 }
 
-/*
- * child_detach()
- * takes a program previously attached to and detaches it.
- * The program resumes execution and will no longer stop
- * on signals, etc.  We better not have left any breakpoints
- * in the program or it'll die when it hits one.  For this
- * to work, it may be necessary for the process to have been
- * previously attached.  It *might* work if the program was
- * started via the normal ptrace (PTRACE_TRACEME).
- */
+
+/* Take a program previously attached to and detaches it.
+   The program resumes execution and will no longer stop
+   on signals, etc.  We'd better not have left any breakpoints
+   in the program or it'll die when it hits one.  For this
+   to work, it may be necessary for the process to have been
+   previously attached.  It *might* work if the program was
+   started via the normal ptrace (PTRACE_TRACEME).  */
 
 static void
 child_detach (args, from_tty)
@@ -459,7 +436,7 @@ child_can_run ()
 {
   return(1);
 }
-
+\f
 struct target_ops child_ops = {
   "child",                     /* to_shortname */
   "Unix child process",                /* to_longname */
This page took 0.024755 seconds and 4 git commands to generate.