(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-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>
+ * 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-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>
+
* linux-thread-db.c (thread_db_mourn_inferior): Remove breakpoints
after mourning the inferior.
# Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-# 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
-# Inc.
+# 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
# This file is part of GDB.
$(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) \
/* Interface GDB to the GNU Hurd.
- Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2006
Free Software Foundation, Inc.
This file is part of GDB.
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"
/* Native debugging support for Intel x86 running DJGPP.
- Copyright (C) 1997, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2001, 2005, 2006
+ Free Software Foundation, Inc.
Written by Robert Hoehne.
This file is part of GDB.
push_target (&go32_ops);
clear_proceed_status ();
insert_breakpoints ();
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
prog_has_started = 1;
}
/* Low-level child interface to ptrace.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000, 2001, 2002, 2004, 2005
+ 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GDB.
{
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 (¤t_target, from_tty);
-
- /* Pedal to the metal... */
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
}
#ifdef PT_GET_PROCESS_STATE
/* Low-level child interface to ttrace.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GDB.
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 (¤t_target, from_tty);
-
- /* Pedal to the metal... */
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
}
static void
/* Memory-access and commands for "inferior" process, for GDB.
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GDB.
#include "solib.h"
#include <ctype.h>
#include "gdb_assert.h"
+#include "observer.h"
/* Functions exported for general use, in inferior.h: */
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
the value now. */
target_create_inferior (exec_file, get_inferior_args (),
environ_vector (inferior_environ), from_tty);
+
+ post_create_inferior (¤t_target, from_tty);
+
+ /* Start the target running. */
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
}
Where it is, why it stopped, and how to step it.
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+ 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GDB.
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);
/* Target-vector operations for controlling Unix child processes, for GDB.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support.
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 (¤t_target, from_tty);
- /* Pedal to the metal... */
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
}
#if !defined(CHILD_POST_STARTUP_INFERIOR)
/* Remote debugging interface for boot monitors, for GDB.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
Resurrected from the ashes by Stu Grossman.
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,
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.
/* Machine independent support for QNX Neutrino /proc (process file system)
for GDB. Written by Colin Burgess at QNX Software Systems Limited.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
Contributed by QNX Software Systems Ltd.
|| (symfile_objfile != NULL && symfile_objfile->obfd != NULL))
solib_create_inferior_hook ();
stop_soon = 0;
- proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
}
static void
/* Target communications support for Macraigor Systems' On-Chip Debugging
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free
- Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006
+ Free Software Foundation, Inc.
This file is part of GDB.
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)
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
/* Machine independent support for SVR4 /proc (process file system) for GDB.
- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006 Free Software Foundation,
Inc.
Written by Michael Snyder at Cygnus Solutions.
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);
}
/*
/* Remote debugging interface for Renesas E7000 ICE, for GDB
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support.
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
/* Remote debugging interface for M32R/SDI.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Renesas Technology Co.
Written by Kei Sakamoto <sakamoto.kei@renesas.com>.
/* 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.
/* Remote debugging interface for MIPS remote debugging protocol.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
/* 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. */
/* Remote debugging for the ARM RDP interface.
- Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 Free
- Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2006
+ Free Software Foundation, Inc.
This file is part of GDB.
** 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 */
/* Remote target communications for serial-line targets using SDS' protocol.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006 Free Software
Foundation, Inc.
This file is part of GDB.
/* 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
/* Generic remote debugging interface for simulators.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2004, 2005 Free Software Foundation, Inc.
+ 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Steve Chamberlain (sac@cygnus.com).
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,
/* Remote debugging interface for Tandem ST2000 phone switch, for GDB.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Jim Kingdon for Cygnus.
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.
/* 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. */
/* Clean up from the last time we were running. */
clear_proceed_status ();
-
- /* Let the remote process run. */
- proceed (-1, TARGET_SIGNAL_0, 0);
}
\f
/* Target-vector operations for controlling win32 child processes, for GDB.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
do_initial_win32_stuff (pi.dwProcessId);
/* win32_continue (DBG_CONTINUE, -1); */
- proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
}
static void
/* Target-vector operations for controlling Windows CE child processes, for GDB.
- Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
This file is part of GDB.
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. */
/* Target-vector operations for controlling win32 child processes, for GDB.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
do_initial_win32_stuff (pi.dwProcessId);
/* win32_continue (DBG_CONTINUE, -1); */
- proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
}
static void