* stabsread.c (get_substring): Declare second arg as int.
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index 27b17adfda722a9becbf572672cdc8b6e6643d92..124022accb85ab20eecb54a9b836dd2f9fa72042 100644 (file)
@@ -217,7 +217,12 @@ gdbsim_open (args, from_tty)
 {
   if (sr_get_debug ())
     printf_filtered ("gdbsim_open: args \"%s\"\n", args ? args : "(null)");
+
+  sim_set_callbacks (&default_callback);
+  default_callback.init (&default_callback);
+
   sim_open (args);
+
   push_target (&gdbsim_ops);
   target_fetch_registers (-1);
   printf_filtered ("Connected to the simulator.\n");
@@ -275,6 +280,9 @@ gdbsim_resume (pid, step, siggnal)
      int pid, step;
      enum target_signal siggnal;
 {
+  if (inferior_pid != 42)
+    error ("The program is not being run.");
+
   if (sr_get_debug ())
     printf_filtered ("gdbsim_resume: step %d, signal %d\n", step, siggnal);
 
@@ -460,7 +468,4 @@ _initialize_remote_sim ()
 
   add_com ("sim <command>", class_obscure, simulator_command,
           "Send a command to the simulator."); 
-
-  sim_set_callbacks (&default_callback);
-  default_callback.init (&default_callback);
 }
This page took 0.023801 seconds and 4 git commands to generate.