1 /* Start and stop the inferior process, for GDB.
2 Copyright (C) 1986, 1987, 1988 Free Software Foundation, Inc.
4 GDB is distributed in the hope that it will be useful, but WITHOUT ANY
5 WARRANTY. No author or distributor accepts responsibility to anyone
6 for the consequences of using it or for whether it serves any
7 particular purpose or works at all, unless he says so in writing.
8 Refer to the GDB General Public License for full details.
10 Everyone is granted permission to copy, modify and redistribute GDB,
11 but only under the conditions described in the GDB General Public
12 License. A copy of this license is supposed to have been given to you
13 along with GDB so you can know your rights and responsibilities. It
14 should be in a file named COPYING. Among other things, the copyright
15 notice and this notice must be preserved on all copies.
17 In other words, go ahead and share GDB, but don't try to stop
18 anyone else from sharing it farther. Help stamp out software hoarding!
22 #include "initialize.h"
34 #include <sys/param.h>
35 #include <sys/ptrace.h>
38 extern char *sys_siglist
[];
41 /* Tables of how to react to signals; the user sets them. */
43 static char signal_stop
[NSIG
];
44 static char signal_print
[NSIG
];
45 static char signal_program
[NSIG
];
47 /* Nonzero if breakpoints are now inserted in the inferior. */
49 static int breakpoints_inserted
;
51 /* Function inferior was in as of last step command. */
53 static struct symbol
*step_start_function
;
55 /* This is the sequence of bytes we insert for a breakpoint. */
57 static char break_insn
[] = BREAKPOINT
;
59 /* Nonzero => address for special breakpoint for resuming stepping. */
61 static CORE_ADDR step_resume_break_address
;
63 /* Original contents of the byte where the special breakpoint is. */
65 static char step_resume_break_shadow
[sizeof break_insn
];
67 /* Nonzero means the special breakpoint is a duplicate
68 so it has not itself been inserted. */
70 static int step_resume_break_duplicate
;
72 /* Nonzero if we are expecting a trace trap and should proceed from it.
73 2 means expecting 2 trace traps and should continue both times.
74 That occurs when we tell sh to exec the program: we will get
75 a trap after the exec of sh and a second when the program is exec'd. */
77 static int trap_expected
;
79 /* Nonzero means expecting a trace trap
80 and should stop the inferior and return silently when it happens. */
82 static int stop_after_trap
;
84 /* Nonzero means expecting a trace trap due to attaching to a process. */
86 static int stop_after_attach
;
88 /* Nonzero if pc has been changed by the debugger
89 since the inferior stopped. */
93 /* Nonzero if debugging a remote machine via a serial link or ethernet. */
97 /* Save register contents here when about to pop a stack dummy frame. */
99 char stop_registers
[REGISTER_BYTES
];
101 /* Nonzero if program stopped due to error trying to insert breakpoints. */
103 static int breakpoints_failed
;
105 /* Nonzero if inferior is in sh before our program got exec'd. */
107 static int running_in_shell
;
109 /* Nonzero after stop if current stack frame should be printed. */
111 static int stop_print_frame
;
113 static void insert_step_breakpoint ();
114 static void remove_step_breakpoint ();
115 static void wait_for_inferior ();
116 static void normal_stop ();
120 /* Clear out all variables saying what to do when inferior is continued.
121 First do this, then set the ones you want, then call `proceed'. */
124 clear_proceed_status ()
127 step_range_start
= 0;
130 step_over_calls
= -1;
131 step_resume_break_address
= 0;
133 stop_after_attach
= 0;
135 /* Discard any remaining commands left by breakpoint we had stopped at. */
136 clear_breakpoint_commands ();
139 /* Basic routine for continuing the program in various fashions.
141 ADDR is the address to resume at, or -1 for resume where stopped.
142 SIGNAL is the signal to give it, or 0 for none,
143 or -1 for act according to how it stopped.
144 STEP is nonzero if should trap after one instruction.
145 -1 means return after that and print nothing.
146 You should probably set various step_... variables
147 before calling here, if you are stepping.
149 You should call clear_proceed_status before calling proceed. */
152 proceed (addr
, signal
, step
)
160 step_start_function
= find_pc_function (read_pc ());
166 /* If there is a breakpoint at the address we will resume at,
167 step one instruction before inserting breakpoints
168 so that we do not stop right away. */
170 if (!pc_changed
&& breakpoint_here_p (read_pc ()))
173 /* We will get a trace trap after one instruction.
174 Continue it automatically and insert breakpoints then. */
179 write_register (PC_REGNUM
, addr
);
183 int temp
= insert_breakpoints ();
186 print_sys_errmsg ("ptrace", temp
);
187 error ("Cannot insert breakpoints.\n\
188 The same program may be running in another process.");
190 breakpoints_inserted
= 1;
193 /* Install inferior's terminal modes. */
194 terminal_inferior ();
197 stop_signal
= signal
;
198 /* If this signal should not be seen by program,
199 give it zero. Used for debugging signals. */
200 else if (stop_signal
< NSIG
&& !signal_program
[stop_signal
])
203 /* Resume inferior. */
204 resume (oneproc
|| step
, stop_signal
);
206 /* Wait for it to stop (if not standalone)
207 and in any case decode why it stopped, and act accordingly. */
209 wait_for_inferior ();
213 /* Writing the inferior pc as a register calls this function
214 to inform infrun that the pc has been set in the debugger. */
223 /* Start an inferior process for the first time.
224 Actually it was started by the fork that created it,
225 but it will have stopped one instruction after execing sh.
226 Here we must get it up to actual execution of the real program. */
230 /* We will get a trace trap after one instruction.
231 Continue it automatically. Eventually (after shell does an exec)
232 it will get another trace trap. Then insert breakpoints and continue. */
234 running_in_shell
= 0; /* Set to 1 at first SIGTRAP, 0 at second. */
235 breakpoints_inserted
= 0;
236 mark_breakpoints_out ();
238 /* Set up the "saved terminal modes" of the inferior
239 based on what modes we are starting it with. */
240 terminal_init_inferior ();
242 /* Install inferior's terminal modes. */
243 terminal_inferior ();
245 if (remote_debugging
)
248 fetch_inferior_registers();
249 set_current_frame (read_register(FP_REGNUM
));
250 stop_frame
= get_current_frame();
252 if (insert_breakpoints())
253 fatal("Can't insert breakpoints");
254 breakpoints_inserted
= 1;
259 wait_for_inferior ();
264 /* Start remote-debugging of a machine over a serial link. */
269 clear_proceed_status ();
270 running_in_shell
= 0;
273 breakpoints_inserted
= 0;
274 mark_breakpoints_out ();
275 wait_for_inferior ();
281 /* Attach to process PID, then initialize for debugging it
282 and wait for the trace-trap that results from attaching. */
291 mark_breakpoints_out ();
292 terminal_init_inferior ();
293 clear_proceed_status ();
294 stop_after_attach
= 1;
295 /*proceed (-1, 0, -2);*/
296 wait_for_inferior ();
299 #endif /* ATTACH_DETACH */
301 /* Wait for control to return from inferior to debugger.
302 If inferior gets a signal, we may decide to start it up again
303 instead of returning. That is why there is a loop in this function.
304 When this function actually returns it means the inferior
305 should be left stopped and GDB should read more commands. */
317 int stop_step_resume_break
;
320 struct symbol
*newfun
;
321 struct symtab_and_line sal
;
326 prev_pc
= read_pc ();
328 if (remote_debugging
)
333 if (pid
!= inferior_pid
)
338 fetch_inferior_registers ();
339 stop_pc
= read_pc ();
340 set_current_frame (read_register (FP_REGNUM
));
341 stop_frame
= get_current_frame ();
342 stop_sp
= read_register (SP_REGNUM
);
346 stop_stack_dummy
= 0;
347 stop_print_frame
= 1;
348 stop_step_resume_break
= 0;
350 breakpoints_failed
= 0;
352 /* Look at the cause of the stop, and decide what to do.
353 The alternatives are:
354 1) break; to really stop and return to the debugger,
355 2) drop through to start up again
356 (set another_trap to 1 to single step once)
357 3) set random_signal to 1, and the decision between 1 and 2
358 will be made according to the signal handling tables. */
362 terminal_ours_for_output ();
364 printf ("\nProgram exited with code 0%o.\n", WRETCODE (w
));
366 printf ("\nProgram exited normally.\n");
369 stop_print_frame
= 0;
372 else if (!WIFSTOPPED (w
))
375 stop_print_frame
= 0;
376 stop_signal
= WTERMSIG (w
);
377 terminal_ours_for_output ();
378 printf ("\nProgram terminated with signal %d, %s\n",
381 ? sys_siglist
[stop_signal
]
383 printf ("The inferior process no longer exists.\n");
389 stop_signal
= WSTOPSIG (w
);
391 /* First, distinguish signals caused by the debugger from signals
392 that have to do with the program's own actions.
393 Note that breakpoint insns may cause SIGTRAP or SIGILL
394 or SIGEMT, depending on the operating system version.
395 Here we detect when a SIGILL or SIGEMT is really a breakpoint
396 and change it to SIGTRAP. */
398 if (stop_signal
== SIGTRAP
399 || (breakpoints_inserted
&&
400 (stop_signal
== SIGILL
401 || stop_signal
== SIGEMT
))
402 || stop_after_attach
)
404 if (stop_signal
== SIGTRAP
&& stop_after_trap
)
406 stop_print_frame
= 0;
409 if (stop_after_attach
)
411 /* Don't even think about breakpoints
412 if still running the shell that will exec the program
413 or if just proceeded over a breakpoint. */
414 if (stop_signal
== SIGTRAP
&& trap_expected
)
417 /* See if there is a breakpoint at the current PC. */
418 #if DECR_PC_AFTER_BREAK
419 /* Notice the case of stepping through a jump
420 that leads just after a breakpoint.
421 Don't confuse that with hitting the breakpoint.
422 What we check for is that 1) stepping is going on
423 and 2) the pc before the last insn does not match
424 the address of the breakpoint before the current pc. */
425 if (!(prev_pc
!= stop_pc
- DECR_PC_AFTER_BREAK
426 && step_range_end
&& !step_resume_break_address
))
427 #endif /* DECR_PC_AFTER_BREAK not zero */
429 select_frame (stop_frame
, 0); /* For condition exprs. */
430 stop_breakpoint
= breakpoint_stop_status (stop_pc
, stop_frame
);
431 /* Following in case break condition called a function. */
432 stop_print_frame
= 1;
433 if (stop_breakpoint
&& DECR_PC_AFTER_BREAK
)
435 stop_pc
-= DECR_PC_AFTER_BREAK
;
436 write_register (PC_REGNUM
, stop_pc
);
440 /* See if we stopped at the special breakpoint for
441 stepping over a subroutine call. */
442 if (stop_pc
- DECR_PC_AFTER_BREAK
== step_resume_break_address
)
444 stop_step_resume_break
= 1;
445 if (DECR_PC_AFTER_BREAK
)
447 stop_pc
-= DECR_PC_AFTER_BREAK
;
448 write_register (PC_REGNUM
, stop_pc
);
453 if (stop_signal
== SIGTRAP
)
455 = !(stop_breakpoint
|| trap_expected
456 || stop_step_resume_break
457 || (stop_sp INNER_THAN stop_pc
&& stop_pc INNER_THAN stop_frame
)
458 || (step_range_end
&& !step_resume_break_address
));
462 = !(stop_breakpoint
|| stop_step_resume_break
);
464 stop_signal
= SIGTRAP
;
470 /* For the program's own signals, act according to
471 the signal handling tables. */
474 && !(running_in_shell
&& stop_signal
== SIGSEGV
))
476 /* Signal not for debugging purposes. */
479 if (stop_signal
>= NSIG
480 || signal_print
[stop_signal
])
483 terminal_ours_for_output ();
484 printf ("\nProgram received signal %d, %s\n",
487 ? sys_siglist
[stop_signal
]
491 if (stop_signal
>= NSIG
492 || signal_stop
[stop_signal
])
494 /* If not going to stop, give terminal back
495 if we took it away. */
497 terminal_inferior ();
500 /* Handle cases caused by hitting a breakpoint. */
503 && (stop_breakpoint
|| stop_step_resume_break
))
505 /* Does a breakpoint want us to stop? */
506 if (stop_breakpoint
&& stop_breakpoint
!= -1)
508 /* 0x1000000 is set in stop_breakpoint as returned by
509 breakpoint_status_p to indicate a silent breakpoint. */
510 if (stop_breakpoint
> 0 && stop_breakpoint
& 0x1000000)
512 stop_breakpoint
&= ~0x1000000;
513 stop_print_frame
= 0;
517 /* But if we have hit the step-resumption breakpoint,
518 remove it. It has done its job getting us here. */
519 if (stop_step_resume_break
520 && (step_frame
== 0 || stop_frame
== step_frame
))
522 remove_step_breakpoint ();
523 step_resume_break_address
= 0;
525 /* Otherwise, must remove breakpoints and single-step
526 to get us past the one we hit. */
529 remove_breakpoints ();
530 remove_step_breakpoint ();
531 breakpoints_inserted
= 0;
535 /* We come here if we hit a breakpoint but should not
536 stop for it. Possibly we also were stepping
537 and should stop for that. So fall through and
538 test for stepping. But, if not stepping,
542 /* If this is the breakpoint at the end of a stack dummy,
543 just stop silently. */
544 if (stop_sp INNER_THAN stop_pc
&& stop_pc INNER_THAN stop_frame
)
546 stop_print_frame
= 0;
547 stop_stack_dummy
= 1;
551 if (step_resume_break_address
)
552 /* Having a step-resume breakpoint overrides anything
553 else having to do with stepping commands until
554 that breakpoint is reached. */
556 /* If stepping through a line, keep going if still within it. */
557 else if (!random_signal
559 && stop_pc
>= step_range_start
560 && stop_pc
< step_range_end
)
562 /* Don't step through the return from a function
563 unless that is the first instruction stepped through. */
564 if (ABOUT_TO_RETURN (stop_pc
))
571 /* We stepped out of the stepping range. See if that was due
572 to a subroutine call that we should proceed to the end of. */
573 else if (!random_signal
&& step_range_end
)
575 newfun
= find_pc_function (stop_pc
);
579 newfun_pc
= BLOCK_START (SYMBOL_BLOCK_VALUE (newfun
))
580 + FUNCTION_START_OFFSET
;
584 newmisc
= find_pc_misc_function (stop_pc
);
586 newfun_pc
= misc_function_vector
[newmisc
].address
587 + FUNCTION_START_OFFSET
;
590 if (stop_pc
== newfun_pc
591 && (step_over_calls
> 0 || (step_over_calls
&& newfun
== 0)))
593 /* A subroutine call has happened. */
594 /* Set a special breakpoint after the return */
595 step_resume_break_address
= SAVED_PC_AFTER_CALL (stop_frame
);
596 step_resume_break_duplicate
597 = breakpoint_here_p (step_resume_break_address
);
598 if (breakpoints_inserted
)
599 insert_step_breakpoint ();
601 /* Subroutine call with source code we should not step over.
602 Do step to the first line of code in it. */
603 else if (stop_pc
== newfun_pc
&& step_over_calls
)
605 SKIP_PROLOGUE (newfun_pc
);
606 sal
= find_pc_line (newfun_pc
, 0);
607 /* Use the step_resume_break to step until
608 the end of the prologue, even if that involves jumps
609 (as it seems to on the vax under 4.2). */
610 /* If the prologue ends in the middle of a source line,
611 continue to the end of that source line.
612 Otherwise, just go to end of prologue. */
613 if (sal
.end
&& sal
.pc
!= newfun_pc
)
614 step_resume_break_address
= sal
.end
;
616 step_resume_break_address
= newfun_pc
;
618 step_resume_break_duplicate
619 = breakpoint_here_p (step_resume_break_address
);
620 if (breakpoints_inserted
)
621 insert_step_breakpoint ();
622 /* Do not specify what the fp should be when we stop
623 since on some machines the prologue
624 is where the new fp value is established. */
626 /* And make sure stepping stops right away then. */
627 step_range_end
= step_range_start
;
629 /* No subroutince call; stop now. */
638 /* If we did not do break;, it means we should keep
639 running the inferior and not return to debugger. */
641 /* If trap_expected is 2, it means continue once more
642 and insert breakpoints at the next trap.
643 If trap_expected is 1 and the signal was SIGSEGV, it means
644 the shell is doing some memory allocation--just resume it
646 Otherwise insert breakpoints now, and possibly single step. */
648 if (trap_expected
> 1)
651 running_in_shell
= 1;
654 else if (running_in_shell
&& stop_signal
== SIGSEGV
)
660 /* Here, we are not awaiting another exec to get
661 the program we really want to debug.
662 Insert breakpoints now, unless we are trying
663 to one-proceed past a breakpoint. */
664 running_in_shell
= 0;
665 if (!breakpoints_inserted
&& !another_trap
)
667 insert_step_breakpoint ();
668 breakpoints_failed
= insert_breakpoints ();
669 if (breakpoints_failed
)
671 breakpoints_inserted
= 1;
674 trap_expected
= another_trap
;
676 if (stop_signal
== SIGTRAP
)
679 resume ((step_range_end
&& !step_resume_break_address
)
686 /* Here to return control to GDB when the inferior stops for real.
687 Print appropriate messages, remove breakpoints, give terminal our modes.
689 RUNNING_IN_SHELL nonzero means the shell got a signal before
690 exec'ing the program we wanted to run.
691 STOP_PRINT_FRAME nonzero means print the executing frame
692 (pc, function, args, file, line number and line text).
693 BREAKPOINTS_FAILED nonzero means stop was due to error
694 attempting to insert breakpoints. */
699 if (breakpoints_failed
)
701 terminal_ours_for_output ();
702 print_sys_errmsg ("ptrace", breakpoints_failed
);
703 printf ("Stopped; cannot insert breakpoints.\n\
704 The same program may be running in another process.\n");
708 remove_step_breakpoint ();
710 if (inferior_pid
&& breakpoints_inserted
)
711 if (remove_breakpoints ())
713 terminal_ours_for_output ();
714 printf ("Cannot remove breakpoints because program is no longer writable.\n\
715 It must be running in another process.\n\
716 Further execution is probably impossible.\n");
719 breakpoints_inserted
= 0;
721 /* Delete the breakpoint we stopped at, if it wants to be deleted.
722 Delete any breakpoint that is to be deleted at the next stop. */
724 breakpoint_auto_delete (stop_breakpoint
);
726 if (step_multi
&& stop_step
)
731 if (running_in_shell
)
733 if (stop_signal
== SIGSEGV
)
735 You have just encountered a bug in \"sh\". GDB starts your program\n\
736 by running \"sh\" with a command to exec your program.\n\
737 This is so that \"sh\" will process wildcards and I/O redirection.\n\
738 This time, \"sh\" crashed.\n\
740 One known bug in \"sh\" bites when the environment takes up a lot of space.\n\
741 Try \"info env\" to see the environment; then use \"unset-env\" to kill\n\
742 some variables whose values are large; then do \"run\" again.\n\
744 If that works, you might want to put those \"unset-env\" commands\n\
745 into a \".gdbinit\" file in this directory so they will happen every time.\n");
746 /* Don't confuse user with his program's symbols on sh's data. */
747 stop_print_frame
= 0;
750 if (inferior_pid
== 0)
753 /* Select innermost stack frame except on return from a stack dummy routine,
754 or if the program has exited. */
755 if (!stop_stack_dummy
)
757 select_frame (stop_frame
, 0);
759 if (stop_print_frame
)
761 if (stop_breakpoint
> 0)
762 printf ("\nBpt %d, ", stop_breakpoint
);
763 print_sel_frame (stop_step
764 && step_frame
== stop_frame
765 && step_start_function
== find_pc_function (stop_pc
));
766 /* Display the auto-display expressions. */
771 /* Save the function value return registers
772 We might be about to restore their previous contents. */
773 read_register_bytes (0, stop_registers
, REGISTER_BYTES
);
775 if (stop_stack_dummy
)
777 /* Pop the empty frame that contains the stack dummy. */
779 select_frame (read_register (FP_REGNUM
), 0);
784 insert_step_breakpoint ()
786 if (step_resume_break_address
&& !step_resume_break_duplicate
)
788 read_memory (step_resume_break_address
,
789 step_resume_break_shadow
, sizeof break_insn
);
790 write_memory (step_resume_break_address
,
791 break_insn
, sizeof break_insn
);
796 remove_step_breakpoint ()
798 if (step_resume_break_address
&& !step_resume_break_duplicate
)
799 write_memory (step_resume_break_address
, step_resume_break_shadow
,
803 /* Specify how various signals in the inferior should be handled. */
806 handle_command (args
, from_tty
)
810 register char *p
= args
;
812 register int digits
, wordlen
;
815 error_no_arg ("signal to handle");
819 /* Find the end of the next word in the args. */
820 for (wordlen
= 0; p
[wordlen
] && p
[wordlen
] != ' ' && p
[wordlen
] != '\t';
822 for (digits
= 0; p
[digits
] >= '0' && p
[digits
] <= '9'; digits
++);
824 /* If it is all digits, it is signal number to operate on. */
825 if (digits
== wordlen
)
828 if (signum
== SIGTRAP
|| signum
== SIGINT
)
830 if (!query ("Signal %d is used by the debugger.\nAre you sure you want to change it? ", signum
))
831 error ("Not confirmed.");
834 else if (signum
== 0)
835 error ("First argument is not a signal number.");
837 /* Else, if already got a signal number, look for flag words
838 saying what to do for it. */
839 else if (!strncmp (p
, "stop", wordlen
))
841 signal_stop
[signum
] = 1;
842 signal_print
[signum
] = 1;
844 else if (wordlen
>= 2 && !strncmp (p
, "print", wordlen
))
845 signal_print
[signum
] = 1;
846 else if (wordlen
>= 2 && !strncmp (p
, "pass", wordlen
))
847 signal_program
[signum
] = 1;
848 else if (!strncmp (p
, "ignore", wordlen
))
849 signal_program
[signum
] = 0;
850 else if (wordlen
>= 3 && !strncmp (p
, "nostop", wordlen
))
851 signal_stop
[signum
] = 0;
852 else if (wordlen
>= 4 && !strncmp (p
, "noprint", wordlen
))
854 signal_print
[signum
] = 0;
855 signal_stop
[signum
] = 0;
857 else if (wordlen
>= 4 && !strncmp (p
, "nopass", wordlen
))
858 signal_program
[signum
] = 0;
859 else if (wordlen
>= 3 && !strncmp (p
, "noignore", wordlen
))
860 signal_program
[signum
] = 1;
861 /* Not a number and not a recognized flag word => complain. */
865 error ("Unrecognized flag word: \"%s\".", p
);
868 /* Find start of next word. */
870 while (*p
== ' ' || *p
== '\t') p
++;
875 /* Show the results. */
876 printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
877 printf ("%d\t", signum
);
878 printf ("%s\t", signal_stop
[signum
] ? "Yes" : "No");
879 printf ("%s\t", signal_print
[signum
] ? "Yes" : "No");
880 printf ("%s\t\t", signal_program
[signum
] ? "Yes" : "No");
881 printf ("%s\n", sys_siglist
[signum
]);
885 /* Print current contents of the tables set by the handle command. */
888 signals_info (signum_exp
)
892 printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
896 i
= parse_and_eval_address (signum_exp
);
898 printf ("%s\t", signal_stop
[i
] ? "Yes" : "No");
899 printf ("%s\t", signal_print
[i
] ? "Yes" : "No");
900 printf ("%s\t\t", signal_program
[i
] ? "Yes" : "No");
901 printf ("%s\n", sys_siglist
[i
]);
906 for (i
= 0; i
< NSIG
; i
++)
909 if (i
> 0 && i
% 16 == 0)
911 printf ("[Type Return to see more]");
916 printf ("%s\t", signal_stop
[i
] ? "Yes" : "No");
917 printf ("%s\t", signal_print
[i
] ? "Yes" : "No");
918 printf ("%s\t\t", signal_program
[i
] ? "Yes" : "No");
919 printf ("%s\n", sys_siglist
[i
]);
922 printf ("\nUse the \"handle\" command to change these tables.\n");
930 add_info ("signals", signals_info
,
931 "What debugger does when program gets various signals.\n\
932 Specify a signal number as argument to print info on that signal only.");
934 add_com ("handle", class_run
, handle_command
,
935 "Specify how to handle a signal.\n\
936 Args are signal number followed by flags.\n\
937 Flags allowed are \"stop\", \"print\", \"pass\",\n\
938 \"nostop\", \"noprint\" or \"nopass\".\n\
939 Print means print a message if this signal happens.\n\
940 Stop means reenter debugger if this signal happens (implies print).\n\
941 Pass means let program see this signal; otherwise program doesn't know.\n\
942 Pass and Stop may be combined.");
944 for (i
= 0; i
< NSIG
; i
++)
948 signal_program
[i
] = 1;
951 /* Signals caused by debugger's own actions
952 should not be given to the program afterwards. */
953 signal_program
[SIGTRAP
] = 0;
954 signal_program
[SIGINT
] = 0;
956 /* Signals that are not errors should not normally enter the debugger. */
958 signal_stop
[SIGALRM
] = 0;
959 signal_print
[SIGALRM
] = 0;
962 signal_stop
[SIGVTALRM
] = 0;
963 signal_print
[SIGVTALRM
] = 0;
964 #endif /* SIGVTALRM */
966 signal_stop
[SIGPROF
] = 0;
967 signal_print
[SIGPROF
] = 0;
970 signal_stop
[SIGCHLD
] = 0;
971 signal_print
[SIGCHLD
] = 0;
974 signal_stop
[SIGCLD
] = 0;
975 signal_print
[SIGCLD
] = 0;
978 signal_stop
[SIGIO
] = 0;
979 signal_print
[SIGIO
] = 0;
982 signal_stop
[SIGURG
] = 0;
983 signal_print
[SIGURG
] = 0;