]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Backport:
authorDaniel Jacobowitz <drow@false.org>
Thu, 26 Jan 2006 18:10:22 +0000 (18:10 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 26 Jan 2006 18:10:22 +0000 (18:10 +0000)
2006-01-24  Daniel Jacobowitz  <dan@codesourcery.com>

* infcmd.c: Include "observer.h".
(post_create_inferior): New function.
(run_command_1): Call it.  Also call proceed.
* inferior.h (post_create_inferior): New prototype.
* Makefile.in (infcmd.o): Update.
...

24 files changed:
ChangeLog.csl
gdb/Makefile.in
gdb/gnu-nat.c
gdb/go32-nat.c
gdb/inf-ptrace.c
gdb/inf-ttrace.c
gdb/infcmd.c
gdb/inferior.h
gdb/inftarg.c
gdb/monitor.c
gdb/nto-procfs.c
gdb/ocd.c
gdb/procfs.c
gdb/remote-e7000.c
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/remote-rdi.c
gdb/remote-rdp.c
gdb/remote-sds.c
gdb/remote-sim.c
gdb/remote-st.c
gdb/remote.c
gdb/win32-nat.c
gdb/wince.c

index 81f2f2bc7ebb7f9f016b1b40eda74bcd35c7c889..633c4042b651779e58c30e4cad5f17fd9f049a38 100644 (file)
@@ -1,3 +1,40 @@
+2006-01-26  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       Backport:
+       2006-01-24  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * infcmd.c: Include "observer.h".
+       (post_create_inferior): New function.
+       (run_command_1): Call it.  Also call proceed.
+       * inferior.h (post_create_inferior): New prototype.
+       * Makefile.in (infcmd.o): Update.
+
+       * gnu-nat.c (gnu_create_inferior): Don't call proceed.
+       * go32-nat.c (go32_create_inferior): Likewise.
+       * nto-procfs.c (procfs_create_inferior): Likewise.
+       * procfs.c (procfs_create_inferior): Likewise.
+       * remote-sim.c (gdbsim_create_inferior): Likewise.
+       * remote.c (extended_remote_create_inferior)
+       (extended_remote_async_create_inferior): Likewise.
+       * win32-nat.c (win32_create_inferior): Likewise.
+       * wince.c (child_create_inferior): Likewise.
+
+       * monitor.c (monitor_create_inferior): Don't call proceed.
+       Set the PC manually.
+       * ocd.c (ocd_create_inferior): Likewise.
+       * remote-e7000.c (e7000_create_inferior): Likewise.
+       * remote-m32r-sdi.c (m32r_create_inferior): Likewise.
+       * remote-mips.c (mips_create_inferior): Likewise.
+       * remote-rdi.c (arm_rdi_create_inferior): Likewise.
+       * remote-rdp.c (remote_rdp_create_inferior): Likewise.
+       * remote-sds.c (sds_create_inferior): Likewise.
+       * remote-st.c (st2000_create_inferior): Likewise.
+
+       * inf-ptrace.c (inf_ptrace_create_inferior): Don't call
+       proceed or observer_notify_inferior_created.
+       * inf-ttrace.c (inf_ttrace_create_inferior): Likewise.
+       * inftarg.c (child_create_inferior): Likewise.
+
 2006-01-13  Mark Mitchell  <mark@codesourcery.com>
 
        Backport:
index 8d8a79e6abb39c8ae5bda779eae73a349397845d..4d0b2d4fa3b36097ff9899011c8f40b599d6ec85 100644 (file)
@@ -2116,7 +2116,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
        $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
        $(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \
        $(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h) \
-       $(solib_h) $(gdb_assert_h)
+       $(solib_h) $(gdb_assert_h) $(observer_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
        $(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
index 4304553607373a0ac1ce5ee515bef73426b31633..94bb9d9ccafafd2f74208014d054d29e8a0f7154 100644 (file)
@@ -2089,9 +2089,6 @@ gnu_create_inferior (char *exec_file, char *allargs, char **env,
     inf_steal_exc_ports (inf);
   else
     inf_restore_exc_ports (inf);
-
-  /* Here we go!  */
-  proceed ((CORE_ADDR) -1, 0, 0);
 }
 
 /* Mark our target-struct as eligible for stray "run" and "attach"
index 0556f578b62b1bfb750c81e1449b4d621280aa2d..4b184f3aa0081b2c0c56911f04a2b6b1b5b5589f 100644 (file)
@@ -657,7 +657,6 @@ go32_create_inferior (char *exec_file, char *args, char **env, int from_tty)
   push_target (&go32_ops);
   clear_proceed_status ();
   insert_breakpoints ();
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
   prog_has_started = 1;
 }
 
index d12d1ad321433092e752c865eba75532ef7175e7..a2fef2213e651fe4786da98a4d8f7c3c23f390a5 100644 (file)
@@ -138,12 +138,6 @@ inf_ptrace_create_inferior (char *exec_file, char *allargs, char **env,
 {
   fork_inferior (exec_file, allargs, env, inf_ptrace_me, inf_ptrace_him,
                 NULL, NULL);
-
-  /* We are at the first instruction we care about.  */
-  observer_notify_inferior_created (&current_target, from_tty);
-
-  /* Pedal to the metal...  */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 #ifdef PT_GET_PROCESS_STATE
index fc19e90b0e1001a0947a3103ca70649672ad84df..19cefa139a8ff528d4c4a606e2a9a72fcd61f20b 100644 (file)
@@ -636,12 +636,6 @@ inf_ttrace_create_inferior (char *exec_file, char *allargs, char **env,
 
   fork_inferior (exec_file, allargs, env, inf_ttrace_me, inf_ttrace_him,
                 inf_ttrace_prepare, NULL);
-
-  /* We are at the first instruction we care about.  */
-  observer_notify_inferior_created (&current_target, from_tty);
-
-  /* Pedal to the metal...  */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 static void
index 43207dce31d4f331e1b2e0468f00903137bcc3b7..8183448b7912444dfa524a464b9ed25aec20d3cc 100644 (file)
@@ -47,6 +47,7 @@
 #include "solib.h"
 #include <ctype.h>
 #include "gdb_assert.h"
+#include "observer.h"
 
 /* Functions exported for general use, in inferior.h: */
 
@@ -397,6 +398,16 @@ tty_command (char *file, int from_tty)
   set_inferior_io_terminal (file);
 }
 
+/* Common actions to take after creating any sort of inferior, by any
+   means (running, attaching, connecting, et cetera).  The target
+   should be stopped.  */
+
+void
+post_create_inferior (struct target_ops *target, int from_tty)
+{
+  observer_notify_inferior_created (target, from_tty);
+}
+
 /* Kill the inferior if already running.  This function is designed
    to be called when we are about to start the execution of the program
    from the beginning.  Ask the user to confirm that he wants to restart
@@ -510,6 +521,11 @@ run_command_1 (char *args, int from_tty, int tbreak_at_main)
      the value now.  */
   target_create_inferior (exec_file, get_inferior_args (),
                          environ_vector (inferior_environ), from_tty);
+
+  post_create_inferior (&current_target, from_tty);
+
+  /* Start the target running.  */
+  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 
index 435bf7ee87eb6d2e5703eec43d562138665674eb..c4df7ad0f8161af4252f0ae384586ceae315e46e 100644 (file)
@@ -296,6 +296,8 @@ extern void follow_inferior_reset_breakpoints (void);
 
 extern void tty_command (char *, int);
 
+extern void post_create_inferior (struct target_ops *, int);
+
 extern void attach_command (char *, int);
 
 extern char *get_inferior_args (void);
index e6abcfaf2f5561e1a59fa73417d85d7215285629..6f1a6099e1c10d2dc376ecaf1589fb4d1b93b937 100644 (file)
@@ -334,11 +334,6 @@ child_create_inferior (char *exec_file, char *allargs, char **env,
                       int from_tty)
 {
   fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL);
-
-  /* We are at the first instruction we care about.  */
-  observer_notify_inferior_created (&current_target, from_tty);
-  /* Pedal to the metal... */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 #if !defined(CHILD_POST_STARTUP_INFERIOR)
index fe856c0dc4b69568bb9c45f12a25961102d2183f..bcbe67ea9cd34c428abae8c463466bd471e84b3c 100644 (file)
@@ -2008,8 +2008,7 @@ monitor_kill (void)
   return;                      /* ignore attempts to kill target system */
 }
 
-/* All we actually do is set the PC to the start address of exec_bfd, and start
-   the program at that point.  */
+/* All we actually do is set the PC to the start address of exec_bfd.  */
 
 static void
 monitor_create_inferior (char *exec_file, char *args, char **env,
@@ -2020,7 +2019,7 @@ monitor_create_inferior (char *exec_file, char *args, char **env,
 
   first_time = 1;
   clear_proceed_status ();
-  proceed (bfd_get_start_address (exec_bfd), TARGET_SIGNAL_0, 0);
+  write_pc (bfd_get_start_address (exec_bfd));
 }
 
 /* Clean up when a program exits.
index 624ef063a58fc5039a0a2f45dd300cfccc451966..af95cafd18206dd2bfa2268616055d8f8f2304dd 100644 (file)
@@ -1093,7 +1093,6 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env,
       || (symfile_objfile != NULL && symfile_objfile->obfd != NULL))
     solib_create_inferior_hook ();
   stop_soon = 0;
-  proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 static void
index 43fe35fc0bbb22a4029bb58cf6c85021e790fb92..b9fe293019206ec240233cc442ad3c26f38f4a9a 100644 (file)
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -1011,8 +1011,7 @@ ocd_mourn (void)
   generic_mourn_inferior ();
 }
 
-/* All we actually do is set the PC to the start address of exec_bfd, and start
-   the program at that point.  */
+/* All we actually do is set the PC to the start address of exec_bfd.  */
 
 void
 ocd_create_inferior (char *exec_file, char *args, char **env, int from_tty)
@@ -1021,7 +1020,7 @@ ocd_create_inferior (char *exec_file, char *args, char **env, int from_tty)
     error (_("Args are not supported by BDM."));
 
   clear_proceed_status ();
-  proceed (bfd_get_start_address (exec_bfd), TARGET_SIGNAL_0, 0);
+  write_pc (bfd_get_start_address (exec_bfd));
 }
 
 void
index 14bcf7d978cfb561c28aacf30325f05835cb08d2..8adeb9bacf054f419fbe69bc0a568ebf3b5ff46f 100644 (file)
@@ -5102,11 +5102,6 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env,
   proc_trace_syscalls_1 (find_procinfo_or_die (PIDGET (inferior_ptid), 0),
                          SYS_syssgi, PR_SYSEXIT, FLAG_RESET, 0);
 #endif
-  
-  /* We are at the first instruction we care about.  */
-  /* Pedal to the metal... */
-
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 /*
index aa430e6eda2fa5c85f570fe89894b7d1b6ad5942..37b0c0dfefdffec4692f070da8dfcf1eae7c39ef 100644 (file)
@@ -405,7 +405,7 @@ e7000_create_inferior (char *execfile, char *args, char **env,
   target_terminal_inferior ();
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
-  proceed ((CORE_ADDR) entry_pt, -1, 0);       /* Let 'er rip... */
+  write_pc ((CORE_ADDR) entry_pt);
 }
 
 /* Open a connection to a remote debugger.  NAME is the filename used
index 41644d04a8d7e5b69550a2a0abea100482f37292..e2c50e6c14c47b0934c24f583dcb75158eca136e 100644 (file)
@@ -338,7 +338,7 @@ m32r_create_inferior (char *execfile, char *args, char **env, int from_tty)
   /* Install inferior's terminal modes.  */
   target_terminal_inferior ();
 
-  proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc (entry_pt);
 }
 
 /* Open a connection to a remote debugger.
index 790b23ea8386593bb2e5e677f99f134af19d0a06..d59072c6e289c3aa5e412123cc9a572bf7aa0a4b 100644 (file)
@@ -2197,7 +2197,7 @@ Can't pass arguments to remote MIPS board; arguments ignored.");
 
   /* FIXME: Should we set inferior_ptid here?  */
 
-  proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc (entry_pt);
 }
 
 /* Clean up after a process.  Actually nothing to do.  */
index 55401755c74c49d38f1e8cf0f0df4894bd72d25a..5522b7a678d42ea407381545836b24c653ba6d4a 100644 (file)
@@ -386,7 +386,7 @@ arm_rdi_create_inferior (char *exec_file, char *args, char **env, int from_tty)
       printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
     }
 
-  proceed (entry_point, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc (entry_point);
 }
 
 /* This takes a program previously attached to and detaches it.  After
index a1f54f79d3c53195213ff34fc55053581c2a9a4e..9125995e43cd2df5099463b1fe981680c268da9b 100644 (file)
@@ -1376,8 +1376,7 @@ remote_rdp_create_inferior (char *exec_file, char *allargs, char **env,
      ** so we don't bother to look for MEMSIZE in the environment.
    */
 
-  /* Let's go! */
-  proceed (entry_point, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc (entry_point);
 }
 
 /* Attach doesn't need to do anything */
index b967c430b9c90c434dbbd66d2624d9f4225acfbc..2e532821c89088e93911b71a3d52a00e6eab0263 100644 (file)
@@ -988,8 +988,7 @@ sds_create_inferior (char *exec_file, char *args, char **env, int from_tty)
   /* Clean up from the last time we were running.  */
   clear_proceed_status ();
 
-  /* Let the remote process run.  */
-  proceed (bfd_get_start_address (exec_bfd), TARGET_SIGNAL_0, 0);
+  write_pc (bfd_get_start_address (exec_bfd));
 }
 
 static void
index e6fc0bdd0e1896fa6521c17e33c84e8f47c3d982..dd9d8be91b9b94aec5f72279945c8edff64ea600 100644 (file)
@@ -458,9 +458,6 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
   insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   clear_proceed_status ();
-
-  /* NB: Entry point already set by sim_create_inferior. */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* The open routine takes the rest of the parameters from the command,
index e90cbc37a0ceb0b87cd0730f4534ef9e6a070c8a..e7dbdad98cfaecadbe53f2adb5635cb569bd9c3f 100644 (file)
@@ -258,8 +258,7 @@ st2000_create_inferior (char *execfile, char *args, char **env,
   target_terminal_inferior ();
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
-  /* Let 'er rip... */
-  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc ((CORE_ADDR) entry_pt);
 }
 
 /* Open a connection to a remote debugger.
index 8113674f55508b193310f4960d43053576254859..80a399add821714c3b3327dbb9450513343c833e 100644 (file)
@@ -4424,9 +4424,6 @@ extended_remote_create_inferior (char *exec_file, char *args,
 
   /* Clean up from the last time we were running.  */
   clear_proceed_status ();
-
-  /* Let the remote process run.  */
-  proceed (-1, TARGET_SIGNAL_0, 0);
 }
 
 /* Async version of extended_remote_create_inferior.  */
@@ -4452,9 +4449,6 @@ extended_remote_async_create_inferior (char *exec_file, char *args,
 
   /* Clean up from the last time we were running.  */
   clear_proceed_status ();
-
-  /* Let the remote process run.  */
-  proceed (-1, TARGET_SIGNAL_0, 0);
 }
 \f
 
index 81c115f898f743bab1e009fbcd11ffcb7caf5640..c371bd24b2aba55a4575361e8403661cefa4d806 100644 (file)
@@ -1894,7 +1894,6 @@ win32_create_inferior (char *exec_file, char *allargs, char **env,
   do_initial_win32_stuff (pi.dwProcessId);
 
   /* win32_continue (DBG_CONTINUE, -1); */
-  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
 }
 
 static void
index 9be5e6fa8a12f05e3f8ac78381bd556a4f722c20..ffaf47ffbcda99ce0981606d88519b08ac2851fd 100644 (file)
@@ -1821,8 +1821,6 @@ child_create_inferior (char *exec_file, char *args, char **env,
   while (!get_child_debug_event (PIDGET (inferior_ptid), &dummy,
                                 CREATE_PROCESS_DEBUG_EVENT, &ret))
     continue;
-
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
 
 /* Chile has gone bye-bye.  */