attach_flag = 0;
}
-/*
-
-LOCAL FUNCTION
-
- procfs_wait -- emulate wait() as much as possible
- Wait for child to do something. Return pid of child, or -1 in case
- of error; store status through argument pointer STATUS.
-
-
-SYNOPSIS
-
- int procfs_wait (int pid, int *statloc)
-
-DESCRIPTION
-
- Try to emulate wait() as much as possible. Not sure why we can't
- just use wait(), but it seems to have problems when applied to a
- process being controlled with the /proc interface.
-
-NOTES
-
- We have a race problem here with no obvious solution. We need to let
- the inferior run until it stops on an event of interest, which means
- that we need to use the PIOCWSTOP ioctl. However, we cannot use this
- ioctl if the process is already stopped on something that is not an
- event of interest, or the call will hang indefinitely. Thus we first
- use PIOCSTATUS to see if the process is not stopped. If not, then we
- use PIOCWSTOP. But during the window between the two, if the process
- stops for any reason that is not an event of interest (such as a job
- control signal) then gdb will hang. One possible workaround is to set
- an alarm to wake up every minute of so and check to see if the process
- is still running, and if so, then reissue the PIOCWSTOP. But this is
- a real kludge, so has not been implemented. FIXME: investigate
- alternatives.
-
- FIXME: Investigate why wait() seems to have problems with programs
- being control by /proc routines.
-
- */
+/* emulate wait() as much as possible.
+ Wait for child to do something. Return pid of child, or -1 in case
+ of error; store status in *OURSTATUS.
+
+ Not sure why we can't
+ just use wait(), but it seems to have problems when applied to a
+ process being controlled with the /proc interface.
+
+ We have a race problem here with no obvious solution. We need to let
+ the inferior run until it stops on an event of interest, which means
+ that we need to use the PIOCWSTOP ioctl. However, we cannot use this
+ ioctl if the process is already stopped on something that is not an
+ event of interest, or the call will hang indefinitely. Thus we first
+ use PIOCSTATUS to see if the process is not stopped. If not, then we
+ use PIOCWSTOP. But during the window between the two, if the process
+ stops for any reason that is not an event of interest (such as a job
+ control signal) then gdb will hang. One possible workaround is to set
+ an alarm to wake up every minute of so and check to see if the process
+ is still running, and if so, then reissue the PIOCWSTOP. But this is
+ a real kludge, so has not been implemented. FIXME: investigate
+ alternatives.
+
+ FIXME: Investigate why wait() seems to have problems with programs
+ being control by /proc routines. */
static int
-procfs_wait (pid, statloc)
+procfs_wait (pid, ourstatus)
int pid;
struct target_waitstatus *ourstatus;
{
expect_prompt ();
#else
insert_breakpoints (); /* Needed to get correct instruction in cache */
- proceed(entry_pt, -1, 0);
+ proceed(entry_pt, TARGET_SIGNAL_DEFAULT, 0);
#endif
} else {
target_terminal_inferior ();
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR)entry_pt, -1, 0); /* Let 'er rip... */
+ proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0); /* Let 'er rip... */
}
/* Translate baud rates from integers to damn B_codes. Unix should
/* trap_expected = 0; */
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR) entry_pt, -1, 0); /* Let 'er rip... */
+ /* Let 'er rip... */
+ proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
expect_prompt ();
insert_breakpoints (); /* Needed to get correct instruction in cache */
- proceed (entry_pt, -1, 0);
+ proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
/* Open a connection to a remote debugger.
/* FIXME: Should we set inferior_pid here? */
- proceed (entry_pt, -1, 0);
+ proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
/* Clean up after a process. Actually nothing to do. */
init_wait_for_inferior ();
clear_proceed_status ();
stop_soon_quietly = 1;
- proceed(-1,-1,0);
+ proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
normal_stop ();
}
/**************************************************** REMOTE_MOURN_INFERIOR */
target_terminal_inferior ();
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR)entry_pt, -1, 0); /* Let 'er rip... */
+
+ /* Let 'er rip... */
+ proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
/* Open a connection to a remote debugger.
target_terminal_inferior ();
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR)entry_pt, -1, 0); /* Let 'er rip... */
+ /* Let 'er rip... */
+ proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
static void
inferior_pid = 42;
insert_breakpoints (); /* Needed to get correct instruction in cache */
- proceed (entry_pt, -1, 0);
+ proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
/* The open routine takes the rest of the parameters from the command,
target_terminal_inferior ();
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR)entry_pt, -1, 0); /* Let 'er rip... */
+ /* Let 'er rip... */
+ proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
/* Open a connection to a remote debugger.
init_wait_for_inferior ();
clear_proceed_status ();
- proceed(-1,-1,0);
+ proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
}
static void
stop_soon_quietly = 0;
/* insert_step_breakpoint (); FIXME, do we need this? */
- proceed(-1, -1, 0);
+ proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
}
/* Fill ARGSTRUCT in argc/argv form with the arguments from the
sim_clear_breakpoints ();
init_wait_for_inferior ();
insert_breakpoints ();
- proceed (entry_pt, -1, 0);
+ proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
}
#if 0
static void