import gdb-1999-07-05 snapshot
[binutils-gdb.git] / gdb / remote-sim.c
index 0c805447b5b957d359367608d6295f1cacb1cc2a..8923aec658d2502eae284c6de05d79acef0718c0 100644 (file)
@@ -39,6 +39,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Prototypes */
 
+extern void _initialize_remote_sim PARAMS ((void));
+
+extern int (*ui_loop_hook) PARAMS ((int signo));
+
 static void dump_mem PARAMS ((char *buf, int len));
 
 static void init_callbacks PARAMS ((void));
@@ -193,10 +197,7 @@ gdb_os_write_stdout (p, buf, len)
     {
       b[0] = buf[i];
       b[1] = 0;
-      if (target_output_hook)
-       target_output_hook (b);
-      else
-       fputs_filtered (b, gdb_stdout);
+      fputs_unfiltered (b, gdb_stdtarg);
     }
   return len;
 }
@@ -225,10 +226,7 @@ gdb_os_write_stderr (p, buf, len)
     {
       b[0] = buf[i];
       b[1] = 0;
-      if (target_output_hook)
-       target_output_hook (b);
-      else
-       fputs_filtered (b, gdb_stderr);
+      fputs_unfiltered (b, gdb_stdtarg);
     }
   return len;
 }
@@ -478,7 +476,7 @@ gdbsim_create_inferior (exec_file, args, env)
       strcat (arg_buf, " ");
       strcat (arg_buf, args);
       argv = buildargv (arg_buf);
-      make_cleanup ((make_cleanup_func) freeargv, argv);
+      make_cleanup_freeargv (argv);
     }
   else
     argv = NULL;
@@ -559,7 +557,7 @@ gdbsim_open (args, from_tty)
   argv = buildargv (arg_buf);
   if (argv == NULL)
     error ("Insufficient memory available to allocate simulator arg list.");
-  make_cleanup ((make_cleanup_func) freeargv, argv);
+  make_cleanup_freeargv (argv);
 
   init_callbacks ();
   gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, argv);
@@ -668,6 +666,9 @@ static int
 gdb_os_poll_quit (p)
      host_callback *p;
 {
+  if (ui_loop_hook != NULL)
+    ui_loop_hook (0);
+
   notice_quit ();
   if (quit_flag) /* gdb's idea of quit */
     {
@@ -919,17 +920,23 @@ simulator_command (args, from_tty)
 /* Define the target subroutine names */
 
 struct target_ops gdbsim_ops ;
-static void init_gdbsim_ops(void)
+
+static void 
+init_gdbsim_ops(void)
 {
   gdbsim_ops.to_shortname =   "sim";           
   gdbsim_ops.to_longname =   "simulator";              
   gdbsim_ops.to_doc =   "Use the compiled-in simulator.";  
   gdbsim_ops.to_open =   gdbsim_open;          
   gdbsim_ops.to_close =   gdbsim_close;                
-  gdbsim_ops.to_attach =   NULL;               
-  gdbsim_ops.to_detach =   gdbsim_detach;      
+  gdbsim_ops.to_attach =   NULL;
+  gdbsim_ops.to_post_attach = NULL;  
+  gdbsim_ops.to_require_attach = NULL; 
+  gdbsim_ops.to_detach =   gdbsim_detach;
+  gdbsim_ops.to_require_detach = NULL; 
   gdbsim_ops.to_resume =   gdbsim_resume;      
-  gdbsim_ops.to_wait  =   gdbsim_wait;         
+  gdbsim_ops.to_wait  =   gdbsim_wait;
+  gdbsim_ops.to_post_wait = NULL;              
   gdbsim_ops.to_fetch_registers  =   gdbsim_fetch_register;
   gdbsim_ops.to_store_registers  =   gdbsim_store_register;
   gdbsim_ops.to_prepare_to_store =   gdbsim_prepare_to_store;
@@ -946,11 +953,30 @@ static void init_gdbsim_ops(void)
   gdbsim_ops.to_load  =   gdbsim_load; 
   gdbsim_ops.to_lookup_symbol =   NULL;        
   gdbsim_ops.to_create_inferior =   gdbsim_create_inferior;
+  gdbsim_ops.to_post_startup_inferior = NULL;
+  gdbsim_ops.to_acknowledge_created_inferior = NULL;
+  gdbsim_ops.to_clone_and_follow_inferior = NULL;
+  gdbsim_ops.to_post_follow_inferior_by_clone = NULL;
+  gdbsim_ops.to_insert_fork_catchpoint = NULL;
+  gdbsim_ops.to_remove_fork_catchpoint = NULL;
+  gdbsim_ops.to_insert_vfork_catchpoint = NULL;
+  gdbsim_ops.to_remove_vfork_catchpoint = NULL;
+  gdbsim_ops.to_has_forked = NULL;
+  gdbsim_ops.to_has_vforked = NULL;
+  gdbsim_ops.to_can_follow_vfork_prior_to_exec = NULL;
+  gdbsim_ops.to_post_follow_vfork = NULL;
+  gdbsim_ops.to_insert_exec_catchpoint = NULL;
+  gdbsim_ops.to_remove_exec_catchpoint = NULL;
+  gdbsim_ops.to_has_execd = NULL;
+  gdbsim_ops.to_reported_exec_events_per_exec_call = NULL;
+  gdbsim_ops.to_has_exited = NULL;
   gdbsim_ops.to_mourn_inferior =   gdbsim_mourn_inferior;
   gdbsim_ops.to_can_run  =   0;                        
   gdbsim_ops.to_notice_signals =   0;          
   gdbsim_ops.to_thread_alive  =   0;           
-  gdbsim_ops.to_stop  =   gdbsim_stop;         
+  gdbsim_ops.to_stop  =   gdbsim_stop;
+  gdbsim_ops.to_pid_to_exec_file = NULL;       
+  gdbsim_ops.to_core_file_to_sym_file = NULL;  
   gdbsim_ops.to_stratum =   process_stratum;   
   gdbsim_ops.DONT_USE =   NULL;                
   gdbsim_ops.to_has_all_memory =   1;  
@@ -971,7 +997,6 @@ void
 _initialize_remote_sim ()
 {
   init_gdbsim_ops() ;
-
   add_target (&gdbsim_ops);
 
   add_com ("sim <command>", class_obscure, simulator_command,