* 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.
This commit is contained in:
Daniel Jacobowitz 2006-01-24 22:09:28 +00:00
parent e23fc6de1a
commit 281b533b6c
24 changed files with 90 additions and 81 deletions

View File

@ -1,3 +1,36 @@
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

View File

@ -1,6 +1,6 @@
# 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.
@ -2122,7 +2122,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) \

View File

@ -1,5 +1,5 @@
/* 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.
@ -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"

View File

@ -1,5 +1,6 @@
/* 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.
@ -657,7 +658,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;
}

View File

@ -1,7 +1,7 @@
/* 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.
@ -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

View File

@ -1,6 +1,6 @@
/* 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.
@ -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

View File

@ -1,7 +1,7 @@
/* 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.
@ -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);
}

View File

@ -2,7 +2,7 @@
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.
@ -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);

View File

@ -1,7 +1,7 @@
/* 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.
@ -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)

View File

@ -1,7 +1,7 @@
/* 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.
@ -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.

View File

@ -1,7 +1,7 @@
/* 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.
@ -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

View File

@ -1,7 +1,7 @@
/* 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.
@ -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

View File

@ -1,6 +1,6 @@
/* 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.
@ -5103,11 +5103,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);
}
/*

View File

@ -1,7 +1,7 @@
/* 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.
@ -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

View File

@ -1,6 +1,6 @@
/* 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>.
@ -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.

View File

@ -1,7 +1,7 @@
/* 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>.
@ -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. */

View File

@ -1,7 +1,7 @@
/* 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.
@ -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 */

View File

@ -1,6 +1,6 @@
/* 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.
@ -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

View File

@ -1,7 +1,7 @@
/* 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).
@ -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,

View File

@ -1,7 +1,7 @@
/* 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.
@ -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.

View File

@ -4423,9 +4423,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. */
@ -4451,9 +4448,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);
}

View File

@ -1,6 +1,7 @@
/* 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.
@ -1909,7 +1910,6 @@ win32_create_inferior (char *exec_file, char *allargs, char **in_env,
do_initial_win32_stuff (pi.dwProcessId);
/* win32_continue (DBG_CONTINUE, -1); */
proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
}
static void

View File

@ -1,6 +1,6 @@
/* 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.
@ -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. */

View File

@ -1,6 +1,7 @@
/* 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.
@ -1909,7 +1910,6 @@ win32_create_inferior (char *exec_file, char *allargs, char **in_env,
do_initial_win32_stuff (pi.dwProcessId);
/* win32_continue (DBG_CONTINUE, -1); */
proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
}
static void