*** empty log message ***
[binutils-gdb.git] / gdb / inf-ptrace.c
index f8050d46a5eda510d91977f6a2ebd8664a5ccb60..ba9d8a8aec9e863cf6c416744b7569a4c47f2f63 100644 (file)
@@ -187,17 +187,9 @@ inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
 {
   char *exec_file;
   pid_t pid;
-  char *dummy;
   struct inferior *inf;
 
-  if (!args)
-    error_no_arg (_("process-id to attach"));
-
-  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."), args);
+  pid = parse_pid_to_attach (args);
 
   if (pid == getpid ())                /* Trying to masturbate?  */
     error (_("I refuse to debug myself!"));