aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-06 20:51:19 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-06 20:51:19 +0000
commitfcbc95a72a768a2f83981961c47337e3d7fcc5ed (patch)
treee003790884657ba1de9b6ede430e781ad4859bf3 /gdb/infrun.c
parent4b2febd355e97ff57838f842def9b358f1a766d0 (diff)
downloadgdb-fcbc95a72a768a2f83981961c47337e3d7fcc5ed.zip
gdb-fcbc95a72a768a2f83981961c47337e3d7fcc5ed.tar.gz
gdb-fcbc95a72a768a2f83981961c47337e3d7fcc5ed.tar.bz2
* target.h: Add TARGET_WAITKIND_LOADED and TARGET_WAITKIND_SPURIOUS.
* target.c (store_waitstatus): Add CHILD_SPECIAL_WAITSTATUS hook. * infrun.c (wait_for_inferior): Replace SIGTRAP_STOP_AFTER_LOAD with code which looks for those two waitkinds. Use switch statement. * config/rs6000/tm-rs6000.h: Replace SIGTRAP_STOP_AFTER_LOAD with CHILD_SPECIAL_WAITSTATUS.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c66
1 files changed, 40 insertions, 26 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 8df0248..3fc8cf1 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1,5 +1,5 @@
/* Target-struct-independent code to start (run) and stop an inferior process.
- Copyright 1986, 1987, 1988, 1989, 1991, 1992, 1993
+ Copyright 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994
Free Software Foundation, Inc.
This file is part of GDB.
@@ -317,12 +317,12 @@ The same program may be running in another process.");
breakpoints_inserted = 1;
}
- if (siggnal >= 0)
+ if (siggnal != TARGET_SIGNAL_DEFAULT)
stop_signal = siggnal;
/* If this signal should not be seen by program,
give it zero. Used for debugging signals. */
else if (!signal_program[stop_signal])
- stop_signal= 0;
+ stop_signal = TARGET_SIGNAL_0;
/* Resume inferior. */
resume (oneproc || step || bpstat_should_step (), stop_signal);
@@ -432,17 +432,23 @@ wait_for_inferior ()
pid = target_wait (-1, &w);
-#ifdef SIGTRAP_STOP_AFTER_LOAD
-
- /* Somebody called load(2), and it gave us a "trap signal after load".
- Ignore it gracefully. */
+ switch (w.kind)
+ {
+ case TARGET_WAITKIND_LOADED:
+ /* Ignore it gracefully. */
+ if (breakpoints_inserted)
+ {
+ mark_breakpoints_out ();
+ insert_breakpoints ();
+ }
+ resume (0, TARGET_SIGNAL_0);
+ continue;
- SIGTRAP_STOP_AFTER_LOAD (w);
-#endif
+ case TARGET_WAITKIND_SPURIOUS:
+ resume (0, TARGET_SIGNAL_0);
+ continue;
- /* See if the process still exists; clean up if it doesn't. */
- if (w.kind == TARGET_WAITKIND_EXITED)
- {
+ case TARGET_WAITKIND_EXITED:
target_terminal_ours (); /* Must do this before mourn anyway */
if (w.value.integer)
printf_filtered ("\nProgram exited with code 0%o.\n",
@@ -456,12 +462,9 @@ wait_for_inferior ()
one_stepped = 0;
#endif
stop_print_frame = 0;
- break;
- }
- else if (w.kind == TARGET_WAITKIND_SIGNALLED)
- {
- char *signame;
+ goto stop_stepping;
+ case TARGET_WAITKIND_SIGNALLED:
stop_print_frame = 0;
stop_signal = w.value.sig;
target_terminal_ours (); /* Must do this before mourn anyway */
@@ -475,6 +478,11 @@ wait_for_inferior ()
#ifdef NO_SINGLE_STEP
one_stepped = 0;
#endif
+ goto stop_stepping;
+
+ case TARGET_WAITKIND_STOPPED:
+ /* This is the only case in which we keep going; the above cases
+ end in a continue or goto. */
break;
}
@@ -1559,15 +1567,18 @@ handle_command (args, from_tty)
error ("Signal %d not in range 0-%d", siglast, nsigs - 1);
}
}
- else if ((oursig = target_signal_from_name (*argv))
- != TARGET_SIGNAL_UNKNOWN)
- {
- sigfirst = siglast = (int)oursig;
- }
else
{
- /* Not a number and not a recognized flag word => complain. */
- error ("Unrecognized or ambiguous flag word: \"%s\".", *argv);
+ oursig = target_signal_from_name (*argv);
+ if (oursig != TARGET_SIGNAL_UNKNOWN)
+ {
+ sigfirst = siglast = (int)oursig;
+ }
+ else
+ {
+ /* Not a number and not a recognized flag word => complain. */
+ error ("Unrecognized or ambiguous flag word: \"%s\".", *argv);
+ }
}
/* If any signal numbers or symbol names were found, set flags for
@@ -1651,7 +1662,8 @@ signals_info (signum_exp, from_tty)
int i = parse_and_eval_address (signum_exp);
if (i >= (int)TARGET_SIGNAL_LAST
|| i < 0
- || i == TARGET_SIGNAL_UNKNOWN)
+ || i == (int)TARGET_SIGNAL_UNKNOWN
+ || i == (int)TARGET_SIGNAL_DEFAULT)
error ("Signal number out of bounds.");
oursig = (enum target_signal)i;
}
@@ -1664,7 +1676,9 @@ signals_info (signum_exp, from_tty)
{
QUIT;
- if (oursig != TARGET_SIGNAL_UNKNOWN)
+ if (oursig != TARGET_SIGNAL_UNKNOWN
+ && oursig != TARGET_SIGNAL_DEFAULT
+ && oursig != TARGET_SIGNAL_0)
sig_print_info (oursig);
}