diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-06 16:34:51 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-06 16:34:51 +0000 |
commit | 45dc9be38877cbb8218182b5c5ebd6e82e5ccd47 (patch) | |
tree | 82ad3d6e6f401a050d61bf80e7fc4e49a6c46c8d /gdb | |
parent | 588d1d685c66966dfdc5c57964e245424060a076 (diff) | |
download | gdb-45dc9be38877cbb8218182b5c5ebd6e82e5ccd47.zip gdb-45dc9be38877cbb8218182b5c5ebd6e82e5ccd47.tar.gz gdb-45dc9be38877cbb8218182b5c5ebd6e82e5ccd47.tar.bz2 |
* procfs.c (procfs_wait): Fix argument name to match 4 Jan changes.
* Move target_signal_from_host, target_signal_to_host, and
store_waitstatus from inftarg.c to target.c. procfs needs them.
* target.c: Include "wait.h" and <signal.h>.
* target.h, infrun.c (proceed), proceed callers: Pass new code
TARGET_SIGNAL_DEFAULT instead of -1. This avoids problems with
enums being treated as unsigned and is cleaner.
* infrun.c (signals_info): Don't print TARGET_SIGNAL_DEFAULT or
TARGET_SIGNAL_0.
* infcmd.c (signal_command), infrun.c (signals_info):
Don't allow user to specify numeric equivalent of
TARGET_SIGNAL_DEFAULT.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/procfs.c | 65 | ||||
-rw-r--r-- | gdb/remote-adapt.c | 2 | ||||
-rw-r--r-- | gdb/remote-eb.c | 2 | ||||
-rw-r--r-- | gdb/remote-es.c | 3 | ||||
-rw-r--r-- | gdb/remote-hms.c | 2 | ||||
-rw-r--r-- | gdb/remote-mips.c | 2 | ||||
-rw-r--r-- | gdb/remote-mm.c | 2 | ||||
-rw-r--r-- | gdb/remote-mon.c | 4 | ||||
-rw-r--r-- | gdb/remote-nindy.c | 3 | ||||
-rw-r--r-- | gdb/remote-sim.c | 2 | ||||
-rw-r--r-- | gdb/remote-st.c | 3 | ||||
-rw-r--r-- | gdb/remote-udi.c | 2 | ||||
-rw-r--r-- | gdb/remote-vx.c | 2 | ||||
-rw-r--r-- | gdb/remote-z8k.c | 2 |
14 files changed, 43 insertions, 53 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 5ebc5e0..c9e0d8f 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2174,48 +2174,33 @@ do_detach (signal) 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; { diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c index fe1586d..1221315 100644 --- a/gdb/remote-adapt.c +++ b/gdb/remote-adapt.c @@ -407,7 +407,7 @@ adapt_create_inferior (execfile, args, env) 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 { diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c index d261549..5cf0c75 100644 --- a/gdb/remote-eb.c +++ b/gdb/remote-eb.c @@ -285,7 +285,7 @@ eb_create_inferior (execfile, args, env) 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 diff --git a/gdb/remote-es.c b/gdb/remote-es.c index 7ee7bf9..c561966 100644 --- a/gdb/remote-es.c +++ b/gdb/remote-es.c @@ -1616,7 +1616,8 @@ es1800_create_inferior (execfile, args, env) /* 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); } diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c index 4e2db42..e86c135 100644 --- a/gdb/remote-hms.c +++ b/gdb/remote-hms.c @@ -485,7 +485,7 @@ hms_create_inferior (execfile, args, env) 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. diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index e230096..e55d0a2 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1339,7 +1339,7 @@ mips_create_inferior (execfile, args, env) /* 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. */ diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c index 91ae155..423ba64 100644 --- a/gdb/remote-mm.c +++ b/gdb/remote-mm.c @@ -180,7 +180,7 @@ Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n"); 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 */ diff --git a/gdb/remote-mon.c b/gdb/remote-mon.c index 0cb5dd7..115822b 100644 --- a/gdb/remote-mon.c +++ b/gdb/remote-mon.c @@ -309,7 +309,9 @@ monitor_create_inferior (execfile, args, env) 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. diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c index aa1fbe3..aef95d5 100644 --- a/gdb/remote-nindy.c +++ b/gdb/remote-nindy.c @@ -609,7 +609,8 @@ nindy_create_inferior (execfile, args, env) 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 diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 1d35ddc..6d4333d 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -196,7 +196,7 @@ gdbsim_create_inferior (exec_file, args, env) 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, diff --git a/gdb/remote-st.c b/gdb/remote-st.c index 7ea3d15..402a4ab 100644 --- a/gdb/remote-st.c +++ b/gdb/remote-st.c @@ -267,7 +267,8 @@ st2000_create_inferior (execfile, args, env) 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. diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index 6f32c00..afe9dd4 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -167,7 +167,7 @@ udi_create_inferior (execfile, args, env) init_wait_for_inferior (); clear_proceed_status (); - proceed(-1,-1,0); + proceed (-1, TARGET_SIGNAL_DEFAULT, 0); } static void diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index abbd918..3bcb680 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -235,7 +235,7 @@ vx_create_inferior (exec_file, args, env) 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 diff --git a/gdb/remote-z8k.c b/gdb/remote-z8k.c index 5ff6e82..20d340d 100644 --- a/gdb/remote-z8k.c +++ b/gdb/remote-z8k.c @@ -158,7 +158,7 @@ sim_create_inferior (execfile, args, env) 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 |