to_notice_signals.
* inferior.h (proc_signal_handling_change): prototype removed.
* infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): default removed.
(handle_command): now calls target_notice_signals.
* procfs.c (proc_signal_handling_change): renamed to
procfs_notice_signals. Now static. Add prototype. All callers
changed.
* target.h (struct target_ops): new field, to_notice_signals.
(target_notice_signals): new macro to cover new field.
* target.c (cleanup_target): default to_notice_signals to ignore.
* corelow.c (core_ops),
exec.c (exec_ops),
inftarg.c (child_ops),
procfs.c (procfs_ops),
remote-adapt.c (adapt-ops),
remote-eb.c (eb_ops),
remote-es1800.c (es1800_ops, es1800_child_ops),
remote-hms.c (hms_ops),
remote-mm.c (mm_ops),
remote-nindy.c (nindy_ops),
remote-st2000.c (st2000_ops),
remote-udi.c (udi_ops),
remote-vx.c (vx_ops, vx_run_ops),
remote.c (remote_ops),
target.c (dummy_target),
xcoffexec.c (exec_ops): added static initializer for
to_notice_signals.
* xm-irix4.h, xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): removed.
+Tue Oct 6 14:47:11 1992 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ NOTICE_SIGNAL_HANDLING_CHANGE macro added to the target vector as
+ to_notice_signals.
+
+ * inferior.h (proc_signal_handling_change): prototype removed.
+ * infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): default removed.
+ (handle_command): now calls target_notice_signals.
+ * procfs.c (proc_signal_handling_change): renamed to
+ procfs_notice_signals. Now static. Add prototype. All callers
+ changed.
+ * target.h (struct target_ops): new field, to_notice_signals.
+ (target_notice_signals): new macro to cover new field.
+ * target.c (cleanup_target): default to_notice_signals to ignore.
+ * corelow.c (core_ops),
+ exec.c (exec_ops),
+ inftarg.c (child_ops),
+ procfs.c (procfs_ops),
+ remote-adapt.c (adapt-ops),
+ remote-eb.c (eb_ops),
+ remote-es1800.c (es1800_ops, es1800_child_ops),
+ remote-hms.c (hms_ops),
+ remote-mm.c (mm_ops),
+ remote-nindy.c (nindy_ops),
+ remote-st2000.c (st2000_ops),
+ remote-udi.c (udi_ops),
+ remote-vx.c (vx_ops, vx_run_ops),
+ remote.c (remote_ops),
+ target.c (dummy_target),
+ xcoffexec.c (exec_ops): added static initializer for
+ to_notice_signals.
+ * xm-irix4.h, xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): removed.
+
Tue Oct 6 12:13:08 1992 John Gilmore (gnu@cygnus.com)
* main.c (define_command): Add forgotten initializer.
0, 0, 0, /* kill, load, lookup sym */
find_default_create_inferior, 0, /* mourn_inferior */
0, /* can_run */
+ 0, /* notice_signals */
core_stratum, 0, /* next */
0, 1, 1, 1, 0, /* all mem, mem, stack, regs, exec */
0, 0, /* section pointers */
#include "breakpoint.h"
#include "wait.h"
#include "gdbcore.h"
-#include "command.h"
+#include "gdbcmd.h"
#include "target.h"
#include <signal.h>
static void
resume_cleanups PARAMS ((int));
+static int
+hook_stop_stub PARAMS ((char *));
+
/* Sigtramp is a routine that the kernel calls (which then calls the
signal handler). On most machines it is a library routine that
is linked into the executable.
#define IN_SOLIB_TRAMPOLINE(pc,name) 0
#endif
-/* Notify other parts of gdb that might care that signal handling may
- have changed for one or more signals. */
-#ifndef NOTICE_SIGNAL_HANDLING_CHANGE
-#define NOTICE_SIGNAL_HANDLING_CHANGE /* No actions */
-#endif
-
#ifdef TDESC
#include "tdesc.h"
int safe_to_init_tdesc_context = 0;
(flags)[signum] = 0; \
} while (0)
+
+/* Command list pointer for the "stop" placeholder. */
+
+static struct cmd_list_element *stop_command;
+
/* Nonzero if breakpoints are now inserted in the inferior. */
-/* Nonstatic for initialization during xxx_create_inferior. FIXME. */
-/*static*/ int breakpoints_inserted;
+static int breakpoints_inserted;
/* Function inferior was in as of last step command. */
void
normal_stop ()
{
+ char *tem;
+ struct cmd_list_element *c;
+
/* Make sure that the current_frame's pc is correct. This
is a correction for setting up the frame info before doing
DECR_PC_AFTER_BREAK */
target_terminal_ours ();
+ /* Look up the hook_stop and run it if it exists. */
+
+ if (stop_command->hook)
+ {
+ catch_errors (hook_stop_stub, (char *)stop_command->hook,
+ "Error while running hook_stop:\n");
+ }
+
if (!target_has_stack)
return;
select_frame (get_current_frame (), 0);
}
}
+
+static int
+hook_stop_stub (cmd)
+ char *cmd;
+{
+ execute_user_command ((struct cmd_list_element *)cmd, 0);
+}
+
\f
static void
insert_step_breakpoint ()
argv++;
}
- NOTICE_SIGNAL_HANDLING_CHANGE;
+ target_notice_signals();
if (from_tty)
{
Ignore is a synonym for nopass and noignore is a synonym for pass.\n\
Pass and Stop may be combined.");
+ stop_command = add_cmd ("stop", class_pseudo, NO_FUNCTION,
+ "There is no `stop' command, but you can set a hook on `stop'.\n\
+This allows you to set a list of commands to be run each time execution\n\
+of the inferior program stops.", &cmdlist);
+
numsigs = signo_max () + 1;
signal_stop = (unsigned char *)
xmalloc (sizeof (signal_stop[0]) * numsigs);
static void
procfs_create_inferior PARAMS ((char *, char *, char **));
+static void
+procfs_notice_signals PARAMS ((void));
+
/* External function prototypes that can't be easily included in any
header file because the args are typedefs in system include files. */
{
memset ((char *) &pi.prrun, 0, sizeof (pi.prrun));
prfillset (&pi.prrun.pr_trace);
- proc_signal_handling_change ();
+ procfs_notice_signals ();
prfillset (&pi.prrun.pr_fault);
prdelset (&pi.prrun.pr_fault, FLTPAGE);
if (ioctl (pi.fd, PIOCWSTOP, &pi.prstatus) < 0)
GLOBAL FUNCTION
- proc_signal_handling_change
+ procfs_notice_signals
SYNOPSIS
- void proc_signal_handling_change (void);
+ static void procfs_notice_signals (void);
DESCRIPTION
involved.
*/
-void
-proc_signal_handling_change ()
+static void
+procfs_notice_signals ()
{
int signo;
memset (&pi.prrun, 0, sizeof (pi.prrun));
prfillset (&pi.prrun.pr_trace);
- proc_signal_handling_change ();
+ procfs_notice_signals ();
prfillset (&pi.prrun.pr_fault);
prdelset (&pi.prrun.pr_fault, FLTPAGE);
if (ioctl (pi.fd, PIOCSFAULT, &pi.prrun.pr_fault))
procfs_create_inferior, /* to_create_inferior */
procfs_mourn_inferior, /* to_mourn_inferior */
procfs_can_run, /* to_can_run */
+ procfs_notice_signals, /* to_notice_signals */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */
adapt_create_inferior, /* create_inferior */
adapt_mourn, /* mourn_inferior FIXME */
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0,0, /* Section pointers */
eb_create_inferior,
eb_mourn_inferior,
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0, 0, /* Section pointers */
es1800_create_inferior, /* to_create_inferior */
NULL, /* to_mourn_inferior */
0, /* to_can_run */
+ 0, /* notice_signals */
core_stratum, /* to_stratum */
0, /* to_next */
0, /* to_has_all_memory */
es1800_create_inferior, /* to_create_inferior */
es1800_mourn_inferior, /* to_mourn_inferior */
0, /* to_can_run */
+ 0, /* notice_signals */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */
hms_create_inferior, /* create_inferior */
hms_mourn, /* mourn_inferior FIXME */
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0,0, /* Section pointers */
mm_create_inferior, /* create_inferior */
mm_mourn, /* mourn_inferior FIXME */
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0,0, /* sections, sections_end */
nindy_create_inferior,
nindy_mourn_inferior,
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0, 0, /* Section pointers */
st2000_create_inferior,
st2000_mourn_inferior,
0, /* can_run */
+ 0, /* notice_signals */
process_stratum,
0, /* next */
1,
udi_create_inferior,
udi_mourn, /* mourn_inferior FIXME */
0, /* can_run */
+ 0, /* notice_signals */
process_stratum,
0, /* next */
1, /* has_all_memory */
vx_lookup_symbol,
vx_create_inferior, 0, /* mourn_inferior */
0, /* can_run */
+ 0, /* notice_signals */
core_stratum, 0, /* next */
1, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
0, 0, /* Section pointers */
vx_lookup_symbol,
0, vx_mourn_inferior,
0, /* can_run */
+ 0, /* notice_signals */
process_stratum, 0, /* next */
0, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
/* all_mem is off to avoid spurious msg in "i files" */
find_default_create_inferior,
0, /* mourn_inferior */
0, /* can_run */
+ 0, /* notice_signals */
file_stratum, 0, /* next */
0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
0, 0, /* section pointers */
*/
#define PSIGNAL_IN_SIGNAL_H
-/* If gdb's signal handling changes (due to a "handle" command), then
- this macro expands to an action to perform to notify other parts of
- gdb that might care, that signal handling has changed. For hosts using
- the /proc interface, gdb has more control over which signals cause the
- inferior to stop and which do not. In some cases, it is desirable to
- have signals delivered directly to the inferior without involving the
- debugger at all. */
-#ifdef USE_PROC_FS
-#define NOTICE_SIGNAL_HANDLING_CHANGE proc_signal_handling_change()
-#endif
-
#define BROKEN_SIGINFO_H /* <sys/siginfo.h> si_pid & si_uid are bogus */
#define NEED_POSIX_SETPGID
-/* If gdb's signal handling changes (due to a "handle" command), then
- this macro expands to an action to perform to notify other parts of
- gdb that might care, that signal handling has changed. For hosts using
- the /proc interface, gdb has more control over which signals cause the
- inferior to stop and which do not. In some cases, it is desirable to
- have signals delivered directly to the inferior without involving the
- debugger at all. */
-
-#ifdef USE_PROC_FS
-#define NOTICE_SIGNAL_HANDLING_CHANGE proc_signal_handling_change()
-#endif
-
/* We have to include these files now, so that GDB will not make
competing definitions in defs.h. */
#include <limits.h>