]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Backport:
authorDaniel Jacobowitz <drow@false.org>
Thu, 26 Jan 2006 18:05:55 +0000 (18:05 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 26 Jan 2006 18:05:55 +0000 (18:05 +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 60b6afd2979d1a0b31e32bff8cfb4a565d3f6855..dd16faf73344967f88827f2a002f3d86981f6daa 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-24  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb/gdbserver/linux-arm-low.c: Move #include below ELF_GREGSET_T
index 9130b564edc2982d2ee9dad1276e34298e9ab83e..2b93e19890fa95070e5290c488ec2b67ccad2764 100644 (file)
@@ -2115,7 +2115,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 a9087afa5788b5acc442f190d30b4d27009b9105..e5bf842bca3e69213fd8f28db03dcca7a3a02643 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 836c77d2792554bcbbb1a64d8ae10983cf9a82cd..5153b52e98dd8b083ef3be0f3e3c59a33812fe98 100644 (file)
@@ -335,11 +335,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 c805eb478348c47794e7e1bd7c8f795d278707bd..8328d312f7d888cba4fdfb4cb06e3d661bc411eb 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 76a245c9973c48ec5ed931a5808da2df5e613a20..8e1051e52c1bbf1a559256b9e272ae4a0c590057 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 9471c1153815bbf771a95f4d94ccef9b8b3dba74..238d9c5542c692710be7a42c6a08c5a3979661a5 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 2d8ef7e513a1f0f4486749638f7749131c91dded..428962c1f1e25f59505ab1e22f83feb6bd274544 100644 (file)
@@ -468,9 +468,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 846e329fd63307ba2fb421cfed6fba86ea5a5308..203afee15127dec4444acffbe7a6267d887273f0 100644 (file)
@@ -4445,9 +4445,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.  */
@@ -4473,9 +4470,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);
 }
 
 /* Store register REGNUM, or all registers if REGNUM == -1, from the contents
index d9525727479d9c3da5590de7cfe343d21d591da7..edae6c68016de901647f18f6cc426130403aeb4e 100644 (file)
@@ -1908,7 +1908,6 @@ child_create_inferior (char *exec_file, char *allargs, char **env,
   do_initial_child_stuff (pi.dwProcessId);
 
   /* child_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.  */