dummy = args; pid = strtol (args, &dummy, 0);  if ((pid == 0) && (args == dummy)) error ("Illegal process-id: %s\n", args);  if (pid == getpid ())	 error ("I refuse to debug myself!");  if (from_tty) { exec_file = (char *) get_exec_file (0);  if (exec_file) printf_unfiltered ("Attaching to program: %s, %s\n", exec_file, target_pid_to_str (pid_to_ptid (pid))); else printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid_to_ptid (pid)));  gdb_flush (gdb_stdout); }
child_attach (char *args, int from_tty){  if (!args)    error_no_arg ("process-id to attach");#ifndef ATTACH_DETACH  error ("Can't attach to a process on this machine.");#else  {    char *exec_file;    int pid;    char *dummy;    dummy = args;    pid = strtol (args, &dummy, 0);    /* Some targets don't set errno on errors, grrr! */    if ((pid == 0) && (args == dummy))      error ("Illegal process-id: %s\n", args);    if (pid == getpid ())	/* Trying to masturbate? */      error ("I refuse to debug myself!");    if (from_tty)      {	exec_file = (char *) get_exec_file (0);	if (exec_file)	  printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,			     target_pid_to_str (pid_to_ptid (pid)));	else	  printf_unfiltered ("Attaching to %s\n",	                     target_pid_to_str (pid_to_ptid (pid)));	gdb_flush (gdb_stdout);      }    attach (pid);    inferior_ptid = pid_to_ptid (pid);    push_target (&child_ops);  }#endif /* ATTACH_DETACH */}