gdbserver x86 on win32: call init_target_desc
[deliverable/binutils-gdb.git] / gdb / gnu-nat.c
index 9935dcb65a29ce1292164007498a7948dc16d3e2..0ad35ca33acd317410b0517929f4670827443f0b 100644 (file)
@@ -2126,12 +2126,13 @@ gnu_ptrace_me (void)
   struct inf *inf = cur_inf ();
   inf_debug (inf, "tracing self");
   if (ptrace (PTRACE_TRACEME) != 0)
-    error (_("ptrace (PTRACE_TRACEME) failed!"));
+    trace_start_error_with_name ("ptrace");
 }
 
 static void
 gnu_create_inferior (struct target_ops *ops, 
-                    char *exec_file, char *allargs, char **env,
+                    const char *exec_file, const std::string &allargs,
+                    char **env,
                     int from_tty)
 {
   struct inf *inf = cur_inf ();
@@ -2142,6 +2143,11 @@ gnu_create_inferior (struct target_ops *ops,
   pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me,
                        NULL, NULL, NULL, NULL);
 
+  /* We have something that executes now.  We'll be running through
+     the shell at this point (if startup-with-shell is true), but the
+     pid shouldn't change.  */
+  add_thread_silent (pid_to_ptid (pid));
+
   /* Attach to the now stopped child, which is actually a shell...  */
   inf_debug (inf, "attaching to child: %d", pid);
 
@@ -2161,7 +2167,8 @@ gnu_create_inferior (struct target_ops *ops,
   thread_change_ptid (inferior_ptid,
                      ptid_build (inf->pid, inf_pick_first_thread (), 0));
 
-  startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
+  gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED);
+
   inf->pending_execs = 0;
   /* Get rid of the old shell threads.  */
   prune_threads ();
@@ -2223,7 +2230,7 @@ gnu_attach (struct target_ops *ops, const char *args, int from_tty)
 
   /* We have to initialize the terminal settings now, since the code
      below might try to restore them.  */
-  target_terminal_init ();
+  target_terminal::init ();
 
   /* If the process was stopped before we attached, make it continue the next
      time the user does a continue.  */
@@ -2652,7 +2659,7 @@ proc_string (struct proc *proc)
   return tid_str;
 }
 
-static char *
+static const char *
 gnu_pid_to_str (struct target_ops *ops, ptid_t ptid)
 {
   struct inf *inf = gnu_current_inf;
@@ -3473,11 +3480,6 @@ to the thread's initial suspend-count when gdb notices the threads."),
           &thread_cmd_list);
 }
 
-\f
-
-/* -Wmissing-prototypes */
-extern initialize_file_ftype _initialize_gnu_nat;
-
 void
 _initialize_gnu_nat (void)
 {
This page took 0.025368 seconds and 4 git commands to generate.