/* 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.
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..."));
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);
procfs_post_attach (pid_t pid)
{
if (exec_bfd)
- solib_create_inferior_hook ();
+ solib_create_inferior_hook (0);
}
static ptid_t
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. */
if (exec_bfd != NULL
|| (symfile_objfile != NULL && symfile_objfile->obfd != NULL))
- solib_create_inferior_hook ();
+ solib_create_inferior_hook (0);
}
static void