2010-02-16 Sami Wagiaalla <swagiaal@redhat.com>
[deliverable/binutils-gdb.git] / gdb / nto-procfs.c
index 0adb045a0e232b52a10e3313b6edc4f6951688c8..3d62ff8a87fad7d7f0063131cf883e3bb25b3d15 100644 (file)
@@ -1,7 +1,8 @@
 /* Machine independent support for QNX Neutrino /proc (process file system)
    for GDB.  Written by Colin Burgess at QNX Software Systems Limited. 
 
-   Copyright (C) 2003, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
@@ -618,10 +619,7 @@ procfs_attach (struct target_ops *ops, char *args, int from_tty)
   int pid;
   struct inferior *inf;
 
-  if (!args)
-    error_no_arg (_("process-id to attach"));
-
-  pid = atoi (args);
+  pid = parse_pid_to_attach (args);
 
   if (pid == getpid ())
     error (_("Attaching GDB to itself is not a good idea..."));
@@ -640,7 +638,8 @@ procfs_attach (struct target_ops *ops, char *args, int from_tty)
       gdb_flush (gdb_stdout);
     }
   inferior_ptid = do_attach (pid_to_ptid (pid));
-  inf = add_inferior (pid);
+  inf = current_inferior ();
+  inferior_appeared (inf, pid);
   inf->attach_flag = 1;
 
   push_target (ops);
@@ -652,7 +651,7 @@ static void
 procfs_post_attach (pid_t pid)
 {
   if (exec_bfd)
-    solib_create_inferior_hook ();
+    solib_create_inferior_hook (0);
 }
 
 static ptid_t
@@ -1196,7 +1195,8 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file,
   inferior_ptid = do_attach (pid_to_ptid (pid));
   procfs_find_new_threads (ops);
 
-  inf = add_inferior (pid);
+  inf = current_inferior ();
+  inferior_appeared (inf, pid);
   inf->attach_flag = 0;
 
   flags = _DEBUG_FLAG_KLC;     /* Kill-on-Last-Close flag.  */
@@ -1212,7 +1212,7 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file,
 
   if (exec_bfd != NULL
       || (symfile_objfile != NULL && symfile_objfile->obfd != NULL))
-    solib_create_inferior_hook ();
+    solib_create_inferior_hook (0);
 }
 
 static void
This page took 0.042731 seconds and 4 git commands to generate.