* target.h: Add enum target_waitkind, enum target_signal, and
[deliverable/binutils-gdb.git] / gdb / infrun.c
CommitLineData
3aa6856a 1/* Target-struct-independent code to start (run) and stop an inferior process.
101b7f9c
PS
2 Copyright 1986, 1987, 1988, 1989, 1991, 1992, 1993
3 Free Software Foundation, Inc.
bd5635a1
RP
4
5This file is part of GDB.
6
3b271cf4 7This program is free software; you can redistribute it and/or modify
bd5635a1 8it under the terms of the GNU General Public License as published by
3b271cf4
JG
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
bd5635a1 11
3b271cf4 12This program is distributed in the hope that it will be useful,
bd5635a1
RP
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
3b271cf4
JG
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
bd5635a1 20
bd5635a1 21#include "defs.h"
d747e0af 22#include <string.h>
a6b98cb9 23#include <ctype.h>
bd5635a1
RP
24#include "symtab.h"
25#include "frame.h"
26#include "inferior.h"
27#include "breakpoint.h"
28#include "wait.h"
29#include "gdbcore.h"
3950a34e 30#include "gdbcmd.h"
bd5635a1 31#include "target.h"
100f92e2 32#include "thread.h"
bd5635a1
RP
33
34#include <signal.h>
35
36/* unistd.h is needed to #define X_OK */
37#ifdef USG
38#include <unistd.h>
39#else
40#include <sys/file.h>
41#endif
42
30875e1c 43/* Prototypes for local functions */
bd5635a1 44
30875e1c 45static void
e37a6e9c 46signals_info PARAMS ((char *, int));
619fd145 47
30875e1c
SG
48static void
49handle_command PARAMS ((char *, int));
50
67ac9759 51static void sig_print_info PARAMS ((enum target_signal));
30875e1c
SG
52
53static void
54sig_print_header PARAMS ((void));
55
30875e1c
SG
56static void
57resume_cleanups PARAMS ((int));
58
3950a34e
RP
59static int
60hook_stop_stub PARAMS ((char *));
61
30875e1c
SG
62/* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the
63 program. It needs to examine the jmp_buf argument and extract the PC
64 from it. The return value is non-zero on success, zero otherwise. */
65#ifndef GET_LONGJMP_TARGET
66#define GET_LONGJMP_TARGET(PC_ADDR) 0
67#endif
68
d747e0af
MT
69
70/* Some machines have trampoline code that sits between function callers
71 and the actual functions themselves. If this machine doesn't have
72 such things, disable their processing. */
73#ifndef SKIP_TRAMPOLINE_CODE
74#define SKIP_TRAMPOLINE_CODE(pc) 0
75#endif
76
b2f03c30
JK
77/* On Irix 5, some function calls automatically skip the first few
78 instructions, so we need a more complicated test to see if we are
79 the start of a function. */
80#ifndef AT_FUNCTION_START
81#define AT_FUNCTION_START(pc,func_name,func_addr) 0
82#endif
83
1eeba686
PB
84/* For SVR4 shared libraries, each call goes through a small piece of
85 trampoline code in the ".init" section. IN_SOLIB_TRAMPOLINE evaluates
86 to nonzero if we are current stopped in one of these. */
87#ifndef IN_SOLIB_TRAMPOLINE
88#define IN_SOLIB_TRAMPOLINE(pc,name) 0
89#endif
d747e0af 90
9f739abd
SG
91/* On some systems, the PC may be left pointing at an instruction that won't
92 actually be executed. This is usually indicated by a bit in the PSW. If
93 we find ourselves in such a state, then we step the target beyond the
94 nullified instruction before returning control to the user so as to avoid
95 confusion. */
96
97#ifndef INSTRUCTION_NULLIFIED
98#define INSTRUCTION_NULLIFIED 0
99#endif
100
bd5635a1
RP
101/* Tables of how to react to signals; the user sets them. */
102
072b552a
JG
103static unsigned char *signal_stop;
104static unsigned char *signal_print;
105static unsigned char *signal_program;
106
107#define SET_SIGS(nsigs,sigs,flags) \
108 do { \
109 int signum = (nsigs); \
110 while (signum-- > 0) \
111 if ((sigs)[signum]) \
112 (flags)[signum] = 1; \
113 } while (0)
114
115#define UNSET_SIGS(nsigs,sigs,flags) \
116 do { \
117 int signum = (nsigs); \
118 while (signum-- > 0) \
119 if ((sigs)[signum]) \
120 (flags)[signum] = 0; \
121 } while (0)
bd5635a1 122
3950a34e
RP
123
124/* Command list pointer for the "stop" placeholder. */
125
126static struct cmd_list_element *stop_command;
127
bd5635a1 128/* Nonzero if breakpoints are now inserted in the inferior. */
bd5635a1 129
3950a34e 130static int breakpoints_inserted;
bd5635a1
RP
131
132/* Function inferior was in as of last step command. */
133
134static struct symbol *step_start_function;
135
bd5635a1
RP
136/* Nonzero if we are expecting a trace trap and should proceed from it. */
137
138static int trap_expected;
139
140/* Nonzero if the next time we try to continue the inferior, it will
141 step one instruction and generate a spurious trace trap.
142 This is used to compensate for a bug in HP-UX. */
143
144static int trap_expected_after_continue;
145
146/* Nonzero means expecting a trace trap
147 and should stop the inferior and return silently when it happens. */
148
149int stop_after_trap;
150
151/* Nonzero means expecting a trap and caller will handle it themselves.
152 It is used after attach, due to attaching to a process;
153 when running in the shell before the child program has been exec'd;
154 and when running some kinds of remote stuff (FIXME?). */
155
156int stop_soon_quietly;
157
bd5635a1
RP
158/* Nonzero if proceed is being used for a "finish" command or a similar
159 situation when stop_registers should be saved. */
160
161int proceed_to_finish;
162
163/* Save register contents here when about to pop a stack dummy frame,
164 if-and-only-if proceed_to_finish is set.
165 Thus this contains the return value from the called function (assuming
166 values are returned in a register). */
167
168char stop_registers[REGISTER_BYTES];
169
170/* Nonzero if program stopped due to error trying to insert breakpoints. */
171
172static int breakpoints_failed;
173
174/* Nonzero after stop if current stack frame should be printed. */
175
176static int stop_print_frame;
177
178#ifdef NO_SINGLE_STEP
179extern int one_stepped; /* From machine dependent code */
180extern void single_step (); /* Same. */
181#endif /* NO_SINGLE_STEP */
182
a71d17b1
JK
183\f
184/* Things to clean up if we QUIT out of resume (). */
e1ce8aa5 185/* ARGSUSED */
a71d17b1
JK
186static void
187resume_cleanups (arg)
188 int arg;
189{
190 normal_stop ();
191}
192
193/* Resume the inferior, but allow a QUIT. This is useful if the user
194 wants to interrupt some lengthy single-stepping operation
195 (for child processes, the SIGINT goes to the inferior, and so
196 we get a SIGINT random_signal, but for remote debugging and perhaps
197 other targets, that's not true).
198
199 STEP nonzero if we should step (zero to continue instead).
200 SIG is the signal to give the inferior (zero for none). */
310cc570 201void
a71d17b1
JK
202resume (step, sig)
203 int step;
67ac9759 204 enum target_signal sig;
a71d17b1
JK
205{
206 struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
207 QUIT;
d11c44f1 208
cef4c2e7
PS
209#ifdef CANNOT_STEP_BREAKPOINT
210 /* Most targets can step a breakpoint instruction, thus executing it
211 normally. But if this one cannot, just continue and we will hit
212 it anyway. */
213 if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
214 step = 0;
215#endif
216
d11c44f1
JG
217#ifdef NO_SINGLE_STEP
218 if (step) {
818de002 219 single_step(sig); /* Do it the hard way, w/temp breakpoints */
d11c44f1
JG
220 step = 0; /* ...and don't ask hardware to do it. */
221 }
222#endif
223
bdbd5f50
JG
224 /* Handle any optimized stores to the inferior NOW... */
225#ifdef DO_DEFERRED_STORES
226 DO_DEFERRED_STORES;
227#endif
228
2f1c7c3f
JK
229 /* Install inferior's terminal modes. */
230 target_terminal_inferior ();
231
de43d7d0 232 target_resume (-1, step, sig);
a71d17b1
JK
233 discard_cleanups (old_cleanups);
234}
235
bd5635a1
RP
236\f
237/* Clear out all variables saying what to do when inferior is continued.
238 First do this, then set the ones you want, then call `proceed'. */
239
240void
241clear_proceed_status ()
242{
243 trap_expected = 0;
244 step_range_start = 0;
245 step_range_end = 0;
246 step_frame_address = 0;
247 step_over_calls = -1;
bd5635a1
RP
248 stop_after_trap = 0;
249 stop_soon_quietly = 0;
250 proceed_to_finish = 0;
251 breakpoint_proceeded = 1; /* We're about to proceed... */
252
253 /* Discard any remaining commands or status from previous stop. */
254 bpstat_clear (&stop_bpstat);
255}
256
257/* Basic routine for continuing the program in various fashions.
258
259 ADDR is the address to resume at, or -1 for resume where stopped.
260 SIGGNAL is the signal to give it, or 0 for none,
261 or -1 for act according to how it stopped.
262 STEP is nonzero if should trap after one instruction.
263 -1 means return after that and print nothing.
264 You should probably set various step_... variables
265 before calling here, if you are stepping.
266
267 You should call clear_proceed_status before calling proceed. */
268
269void
270proceed (addr, siggnal, step)
271 CORE_ADDR addr;
67ac9759 272 enum target_signal siggnal;
bd5635a1
RP
273 int step;
274{
275 int oneproc = 0;
276
277 if (step > 0)
278 step_start_function = find_pc_function (read_pc ());
279 if (step < 0)
280 stop_after_trap = 1;
281
bdbd5f50 282 if (addr == (CORE_ADDR)-1)
bd5635a1
RP
283 {
284 /* If there is a breakpoint at the address we will resume at,
285 step one instruction before inserting breakpoints
286 so that we do not stop right away. */
287
37c99ddb 288 if (breakpoint_here_p (read_pc ()))
bd5635a1
RP
289 oneproc = 1;
290 }
291 else
101b7f9c 292 write_pc (addr);
bd5635a1
RP
293
294 if (trap_expected_after_continue)
295 {
296 /* If (step == 0), a trap will be automatically generated after
297 the first instruction is executed. Force step one
298 instruction to clear this condition. This should not occur
299 if step is nonzero, but it is harmless in that case. */
300 oneproc = 1;
301 trap_expected_after_continue = 0;
302 }
303
304 if (oneproc)
305 /* We will get a trace trap after one instruction.
306 Continue it automatically and insert breakpoints then. */
307 trap_expected = 1;
308 else
309 {
310 int temp = insert_breakpoints ();
311 if (temp)
312 {
313 print_sys_errmsg ("ptrace", temp);
314 error ("Cannot insert breakpoints.\n\
315The same program may be running in another process.");
316 }
317 breakpoints_inserted = 1;
318 }
319
bd5635a1
RP
320 if (siggnal >= 0)
321 stop_signal = siggnal;
322 /* If this signal should not be seen by program,
323 give it zero. Used for debugging signals. */
67ac9759 324 else if (!signal_program[stop_signal])
bd5635a1
RP
325 stop_signal= 0;
326
bd5635a1 327 /* Resume inferior. */
a71d17b1 328 resume (oneproc || step || bpstat_should_step (), stop_signal);
bd5635a1
RP
329
330 /* Wait for it to stop (if not standalone)
331 and in any case decode why it stopped, and act accordingly. */
332
333 wait_for_inferior ();
334 normal_stop ();
335}
336
bd5635a1
RP
337/* Record the pc and sp of the program the last time it stopped.
338 These are just used internally by wait_for_inferior, but need
339 to be preserved over calls to it and cleared when the inferior
340 is started. */
341static CORE_ADDR prev_pc;
342static CORE_ADDR prev_sp;
343static CORE_ADDR prev_func_start;
344static char *prev_func_name;
345
a71d17b1 346\f
bd5635a1
RP
347/* Start remote-debugging of a machine over a serial link. */
348
349void
350start_remote ()
351{
352 init_wait_for_inferior ();
353 clear_proceed_status ();
354 stop_soon_quietly = 1;
355 trap_expected = 0;
98885d76
JK
356 wait_for_inferior ();
357 normal_stop ();
bd5635a1
RP
358}
359
360/* Initialize static vars when a new inferior begins. */
361
362void
363init_wait_for_inferior ()
364{
365 /* These are meaningless until the first time through wait_for_inferior. */
366 prev_pc = 0;
367 prev_sp = 0;
368 prev_func_start = 0;
369 prev_func_name = NULL;
370
371 trap_expected_after_continue = 0;
372 breakpoints_inserted = 0;
cf3e377e 373 breakpoint_init_inferior ();
67ac9759
JK
374
375 /* Don't confuse first call to proceed(). */
376 stop_signal = TARGET_SIGNAL_0;
bd5635a1
RP
377}
378
fe675038
JK
379static void
380delete_breakpoint_current_contents (arg)
381 PTR arg;
382{
383 struct breakpoint **breakpointp = (struct breakpoint **)arg;
384 if (*breakpointp != NULL)
385 delete_breakpoint (*breakpointp);
386}
bd5635a1
RP
387\f
388/* Wait for control to return from inferior to debugger.
389 If inferior gets a signal, we may decide to start it up again
390 instead of returning. That is why there is a loop in this function.
391 When this function actually returns it means the inferior
392 should be left stopped and GDB should read more commands. */
393
394void
395wait_for_inferior ()
396{
fe675038 397 struct cleanup *old_cleanups;
67ac9759 398 struct target_waitstatus w;
bd5635a1
RP
399 int another_trap;
400 int random_signal;
37c99ddb 401 CORE_ADDR stop_sp = 0;
bd5635a1 402 CORE_ADDR stop_func_start;
67ac9759 403 CORE_ADDR stop_func_end;
bd5635a1 404 char *stop_func_name;
37c99ddb 405 CORE_ADDR prologue_pc = 0, tmp;
bd5635a1
RP
406 struct symtab_and_line sal;
407 int remove_breakpoints_on_following_step = 0;
b3b39c0c 408 int current_line;
b2f03c30 409 struct symtab *current_symtab;
30875e1c 410 int handling_longjmp = 0; /* FIXME */
fe675038 411 struct breakpoint *step_resume_breakpoint = NULL;
37c99ddb 412 int pid;
bd5635a1 413
fe675038
JK
414 old_cleanups = make_cleanup (delete_breakpoint_current_contents,
415 &step_resume_breakpoint);
b3b39c0c
SG
416 sal = find_pc_line(prev_pc, 0);
417 current_line = sal.line;
b2f03c30 418 current_symtab = sal.symtab;
b3b39c0c 419
cb6b0202
JK
420 /* Are we stepping? */
421#define CURRENTLY_STEPPING() ((step_resume_breakpoint == NULL \
422 && !handling_longjmp \
423 && (step_range_end \
424 || trap_expected)) \
425 || bpstat_should_step ())
426
bd5635a1
RP
427 while (1)
428 {
429 /* Clean up saved state that will become invalid. */
bd5635a1
RP
430 flush_cached_frames ();
431 registers_changed ();
432
de43d7d0 433 pid = target_wait (-1, &w);
bd5635a1 434
1eeba686
PB
435#ifdef SIGTRAP_STOP_AFTER_LOAD
436
437 /* Somebody called load(2), and it gave us a "trap signal after load".
438 Ignore it gracefully. */
439
440 SIGTRAP_STOP_AFTER_LOAD (w);
441#endif
442
bd5635a1 443 /* See if the process still exists; clean up if it doesn't. */
67ac9759 444 if (w.kind == TARGET_WAITKIND_EXITED)
bd5635a1
RP
445 {
446 target_terminal_ours (); /* Must do this before mourn anyway */
67ac9759 447 if (w.value.integer)
e37a6e9c 448 printf_filtered ("\nProgram exited with code 0%o.\n",
67ac9759 449 (unsigned int)w.value.integer);
bd5635a1
RP
450 else
451 if (!batch_mode())
e37a6e9c 452 printf_filtered ("\nProgram exited normally.\n");
199b2450 453 gdb_flush (gdb_stdout);
bd5635a1
RP
454 target_mourn_inferior ();
455#ifdef NO_SINGLE_STEP
456 one_stepped = 0;
457#endif
458 stop_print_frame = 0;
459 break;
460 }
67ac9759 461 else if (w.kind == TARGET_WAITKIND_SIGNALLED)
bd5635a1 462 {
fee44494 463 char *signame;
67ac9759 464
bd5635a1 465 stop_print_frame = 0;
67ac9759 466 stop_signal = w.value.sig;
bd5635a1 467 target_terminal_ours (); /* Must do this before mourn anyway */
30875e1c 468 target_kill (); /* kill mourns as well */
67ac9759
JK
469 printf_filtered ("\nProgram terminated with signal %s, %s.\n",
470 target_signal_to_name (stop_signal),
471 target_signal_to_string (stop_signal));
472
fee44494 473 printf_filtered ("The program no longer exists.\n");
199b2450 474 gdb_flush (gdb_stdout);
bd5635a1
RP
475#ifdef NO_SINGLE_STEP
476 one_stepped = 0;
477#endif
478 break;
479 }
de43d7d0 480
67ac9759 481 stop_signal = w.value.sig;
de43d7d0
SG
482
483 if (pid != inferior_pid)
484 {
485 int save_pid = inferior_pid;
486
487 inferior_pid = pid; /* Setup for target memory/regs */
488 registers_changed ();
489 stop_pc = read_pc ();
490 inferior_pid = save_pid;
491 registers_changed ();
492 }
493 else
494 stop_pc = read_pc ();
495
67ac9759 496 if (stop_signal == TARGET_SIGNAL_TRAP
de43d7d0 497 && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
b2f03c30
JK
498 {
499 if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK, pid))
500 {
501 /* Saw a breakpoint, but it was hit by the wrong thread. Just continue. */
502 if (breakpoints_inserted)
503 {
504 if (pid != inferior_pid)
505 {
506 int save_pid = inferior_pid;
507
508 inferior_pid = pid;
509 registers_changed ();
510 write_pc (stop_pc - DECR_PC_AFTER_BREAK);
511 inferior_pid = save_pid;
512 registers_changed ();
513 }
514 else
515 write_pc (stop_pc - DECR_PC_AFTER_BREAK);
516
517 remove_breakpoints ();
67ac9759 518 target_resume (pid, 1, TARGET_SIGNAL_0); /* Single step */
b2f03c30
JK
519 /* FIXME: What if a signal arrives instead of the single-step
520 happening? */
521 target_wait (pid, &w);
522 insert_breakpoints ();
523 }
67ac9759 524 target_resume (-1, 0, TARGET_SIGNAL_0);
b2f03c30
JK
525 continue;
526 }
527 else
528 if (pid != inferior_pid)
529 goto switch_thread;
530 }
de43d7d0 531
37c99ddb
JK
532 if (pid != inferior_pid)
533 {
534 int printed = 0;
535
536 if (!in_thread_list (pid))
537 {
199b2450 538 fprintf_unfiltered (gdb_stderr, "[New %s]\n", target_pid_to_str (pid));
37c99ddb
JK
539 add_thread (pid);
540
67ac9759 541 target_resume (-1, 0, TARGET_SIGNAL_0);
37c99ddb
JK
542 continue;
543 }
544 else
545 {
67ac9759 546 if (signal_print[stop_signal])
37c99ddb
JK
547 {
548 char *signame;
549
550 printed = 1;
551 target_terminal_ours_for_output ();
67ac9759
JK
552 printf_filtered ("\nProgram received signal %s, %s.\n",
553 target_signal_to_name (stop_signal),
554 target_signal_to_string (stop_signal));
199b2450 555 gdb_flush (gdb_stdout);
37c99ddb
JK
556 }
557
67ac9759 558 if (stop_signal == TARGET_SIGNAL_TRAP
de43d7d0 559 || signal_stop[stop_signal])
37c99ddb 560 {
de43d7d0 561switch_thread:
37c99ddb
JK
562 inferior_pid = pid;
563 printf_filtered ("[Switching to %s]\n", target_pid_to_str (pid));
564
565 flush_cached_frames ();
566 registers_changed ();
567 trap_expected = 0;
568 if (step_resume_breakpoint)
569 {
570 delete_breakpoint (step_resume_breakpoint);
571 step_resume_breakpoint = NULL;
572 }
573 prev_pc = 0;
574 prev_sp = 0;
575 prev_func_name = NULL;
576 step_range_start = 0;
577 step_range_end = 0;
578 step_frame_address = 0;
579 handling_longjmp = 0;
580 another_trap = 0;
581 }
582 else
583 {
584 if (printed)
585 target_terminal_inferior ();
586
587 /* Clear the signal if it should not be passed. */
588 if (signal_program[stop_signal] == 0)
67ac9759 589 stop_signal = TARGET_SIGNAL_0;
37c99ddb 590
b2f03c30 591 target_resume (pid, 0, stop_signal);
37c99ddb
JK
592 continue;
593 }
594 }
595 }
596
bd5635a1
RP
597#ifdef NO_SINGLE_STEP
598 if (one_stepped)
599 single_step (0); /* This actually cleans up the ss */
600#endif /* NO_SINGLE_STEP */
601
9f739abd
SG
602/* If PC is pointing at a nullified instruction, then step beyond it so that
603 the user won't be confused when GDB appears to be ready to execute it. */
604
605 if (INSTRUCTION_NULLIFIED)
606 {
607 resume (1, 0);
608 continue;
609 }
610
37c99ddb 611 set_current_frame ( create_new_frame (read_fp (), stop_pc));
fe675038 612
bd5635a1 613 stop_frame_address = FRAME_FP (get_current_frame ());
fee44494 614 stop_sp = read_sp ();
bd5635a1
RP
615 stop_func_start = 0;
616 stop_func_name = 0;
617 /* Don't care about return value; stop_func_start and stop_func_name
618 will both be 0 if it doesn't work. */
37c99ddb 619 find_pc_partial_function (stop_pc, &stop_func_name, &stop_func_start,
67ac9759 620 &stop_func_end);
bd5635a1
RP
621 stop_func_start += FUNCTION_START_OFFSET;
622 another_trap = 0;
623 bpstat_clear (&stop_bpstat);
624 stop_step = 0;
625 stop_stack_dummy = 0;
626 stop_print_frame = 1;
bd5635a1
RP
627 random_signal = 0;
628 stopped_by_random_signal = 0;
629 breakpoints_failed = 0;
630
631 /* Look at the cause of the stop, and decide what to do.
632 The alternatives are:
633 1) break; to really stop and return to the debugger,
634 2) drop through to start up again
635 (set another_trap to 1 to single step once)
636 3) set random_signal to 1, and the decision between 1 and 2
637 will be made according to the signal handling tables. */
638
bd5635a1
RP
639 /* First, distinguish signals caused by the debugger from signals
640 that have to do with the program's own actions.
641 Note that breakpoint insns may cause SIGTRAP or SIGILL
642 or SIGEMT, depending on the operating system version.
643 Here we detect when a SIGILL or SIGEMT is really a breakpoint
644 and change it to SIGTRAP. */
645
67ac9759 646 if (stop_signal == TARGET_SIGNAL_TRAP
bd5635a1 647 || (breakpoints_inserted &&
67ac9759
JK
648 (stop_signal == TARGET_SIGNAL_ILL
649 || stop_signal == TARGET_SIGNAL_EMT
e37a6e9c 650 ))
bd5635a1
RP
651 || stop_soon_quietly)
652 {
67ac9759 653 if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
bd5635a1
RP
654 {
655 stop_print_frame = 0;
656 break;
657 }
658 if (stop_soon_quietly)
659 break;
660
661 /* Don't even think about breakpoints
662 if just proceeded over a breakpoint.
663
664 However, if we are trying to proceed over a breakpoint
fe675038 665 and end up in sigtramp, then step_resume_breakpoint
bd5635a1
RP
666 will be set and we should check whether we've hit the
667 step breakpoint. */
67ac9759 668 if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected
fe675038 669 && step_resume_breakpoint == NULL)
bd5635a1
RP
670 bpstat_clear (&stop_bpstat);
671 else
672 {
673 /* See if there is a breakpoint at the current PC. */
cb6b0202
JK
674 stop_bpstat = bpstat_stop_status
675 (&stop_pc, stop_frame_address,
bd5635a1 676#if DECR_PC_AFTER_BREAK
cb6b0202
JK
677 /* Notice the case of stepping through a jump
678 that lands just after a breakpoint.
679 Don't confuse that with hitting the breakpoint.
680 What we check for is that 1) stepping is going on
681 and 2) the pc before the last insn does not match
682 the address of the breakpoint before the current pc. */
683 (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
684 && CURRENTLY_STEPPING ())
685#else /* DECR_PC_AFTER_BREAK zero */
686 0
687#endif /* DECR_PC_AFTER_BREAK zero */
688 );
689 /* Following in case break condition called a
690 function. */
691 stop_print_frame = 1;
bd5635a1 692 }
fe675038 693
67ac9759 694 if (stop_signal == TARGET_SIGNAL_TRAP)
bd5635a1
RP
695 random_signal
696 = !(bpstat_explains_signal (stop_bpstat)
697 || trap_expected
84d59861 698#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
bd5635a1 699 || PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address)
84d59861 700#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
fe675038 701 || (step_range_end && step_resume_breakpoint == NULL));
bd5635a1
RP
702 else
703 {
704 random_signal
705 = !(bpstat_explains_signal (stop_bpstat)
bd5635a1
RP
706 /* End of a stack dummy. Some systems (e.g. Sony
707 news) give another signal besides SIGTRAP,
708 so check here as well as above. */
84d59861 709#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
d747e0af 710 || PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address)
84d59861 711#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
bd5635a1
RP
712 );
713 if (!random_signal)
67ac9759 714 stop_signal = TARGET_SIGNAL_TRAP;
bd5635a1
RP
715 }
716 }
717 else
718 random_signal = 1;
fe675038 719
bd5635a1
RP
720 /* For the program's own signals, act according to
721 the signal handling tables. */
fe675038 722
bd5635a1
RP
723 if (random_signal)
724 {
725 /* Signal not for debugging purposes. */
726 int printed = 0;
727
728 stopped_by_random_signal = 1;
729
67ac9759 730 if (signal_print[stop_signal])
bd5635a1 731 {
fee44494 732 char *signame;
bd5635a1
RP
733 printed = 1;
734 target_terminal_ours_for_output ();
67ac9759
JK
735 printf_filtered ("\nProgram received signal %s, %s.\n",
736 target_signal_to_name (stop_signal),
737 target_signal_to_string (stop_signal));
199b2450 738 gdb_flush (gdb_stdout);
bd5635a1 739 }
67ac9759 740 if (signal_stop[stop_signal])
bd5635a1
RP
741 break;
742 /* If not going to stop, give terminal back
743 if we took it away. */
744 else if (printed)
745 target_terminal_inferior ();
b7f81b57 746
101b7f9c
PS
747 /* Clear the signal if it should not be passed. */
748 if (signal_program[stop_signal] == 0)
67ac9759 749 stop_signal = TARGET_SIGNAL_0;
101b7f9c 750
fe675038
JK
751 /* I'm not sure whether this needs to be check_sigtramp2 or
752 whether it could/should be keep_going. */
753 goto check_sigtramp2;
bd5635a1 754 }
30875e1c 755
bd5635a1 756 /* Handle cases caused by hitting a breakpoint. */
fe675038
JK
757 {
758 CORE_ADDR jmp_buf_pc;
29c6dce2
JK
759 struct bpstat_what what;
760
761 what = bpstat_what (stop_bpstat);
bd5635a1 762
84d59861
JK
763 if (what.call_dummy)
764 {
765 stop_stack_dummy = 1;
766#ifdef HP_OS_BUG
767 trap_expected_after_continue = 1;
768#endif
769 }
770
fe675038
JK
771 switch (what.main_action)
772 {
773 case BPSTAT_WHAT_SET_LONGJMP_RESUME:
774 /* If we hit the breakpoint at longjmp, disable it for the
775 duration of this command. Then, install a temporary
776 breakpoint at the target of the jmp_buf. */
777 disable_longjmp_breakpoint();
778 remove_breakpoints ();
779 breakpoints_inserted = 0;
780 if (!GET_LONGJMP_TARGET(&jmp_buf_pc)) goto keep_going;
781
782 /* Need to blow away step-resume breakpoint, as it
783 interferes with us */
784 if (step_resume_breakpoint != NULL)
785 {
786 delete_breakpoint (step_resume_breakpoint);
787 step_resume_breakpoint = NULL;
788 what.step_resume = 0;
789 }
30875e1c 790
101b7f9c 791#if 0
fe675038
JK
792 /* FIXME - Need to implement nested temporary breakpoints */
793 if (step_over_calls > 0)
794 set_longjmp_resume_breakpoint(jmp_buf_pc,
795 get_current_frame());
796 else
30875e1c 797#endif /* 0 */
fe675038
JK
798 set_longjmp_resume_breakpoint(jmp_buf_pc, NULL);
799 handling_longjmp = 1; /* FIXME */
800 goto keep_going;
801
802 case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME:
803 case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
804 remove_breakpoints ();
805 breakpoints_inserted = 0;
101b7f9c 806#if 0
fe675038
JK
807 /* FIXME - Need to implement nested temporary breakpoints */
808 if (step_over_calls
809 && (stop_frame_address
810 INNER_THAN step_frame_address))
811 {
812 another_trap = 1;
813 goto keep_going;
814 }
30875e1c 815#endif /* 0 */
fe675038
JK
816 disable_longjmp_breakpoint();
817 handling_longjmp = 0; /* FIXME */
818 if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
101b7f9c 819 break;
fe675038
JK
820 /* else fallthrough */
821
822 case BPSTAT_WHAT_SINGLE:
823 if (breakpoints_inserted)
824 remove_breakpoints ();
825 breakpoints_inserted = 0;
826 another_trap = 1;
827 /* Still need to check other stuff, at least the case
828 where we are stepping and step out of the right range. */
829 break;
830
831 case BPSTAT_WHAT_STOP_NOISY:
832 stop_print_frame = 1;
833 /* We are about to nuke the step_resume_breakpoint via the
834 cleanup chain, so no need to worry about it here. */
835 goto stop_stepping;
101b7f9c 836
fe675038
JK
837 case BPSTAT_WHAT_STOP_SILENT:
838 stop_print_frame = 0;
839 /* We are about to nuke the step_resume_breakpoint via the
840 cleanup chain, so no need to worry about it here. */
841 goto stop_stepping;
842
100f92e2
JK
843 case BPSTAT_WHAT_LAST:
844 /* Not a real code, but listed here to shut up gcc -Wall. */
845
fe675038
JK
846 case BPSTAT_WHAT_KEEP_CHECKING:
847 break;
848 }
849
850 if (what.step_resume)
30875e1c 851 {
fe675038
JK
852 delete_breakpoint (step_resume_breakpoint);
853 step_resume_breakpoint = NULL;
30875e1c 854
fe675038
JK
855 /* If were waiting for a trap, hitting the step_resume_break
856 doesn't count as getting it. */
857 if (trap_expected)
858 another_trap = 1;
30875e1c 859 }
fe675038 860 }
30875e1c
SG
861
862 /* We come here if we hit a breakpoint but should not
863 stop for it. Possibly we also were stepping
864 and should stop for that. So fall through and
865 test for stepping. But, if not stepping,
866 do not stop. */
867
84d59861
JK
868#ifndef CALL_DUMMY_BREAKPOINT_OFFSET
869 /* This is the old way of detecting the end of the stack dummy.
870 An architecture which defines CALL_DUMMY_BREAKPOINT_OFFSET gets
871 handled above. As soon as we can test it on all of them, all
872 architectures should define it. */
873
bd5635a1 874 /* If this is the breakpoint at the end of a stack dummy,
c9de302b
SG
875 just stop silently, unless the user was doing an si/ni, in which
876 case she'd better know what she's doing. */
877
878 if (PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address)
879 && !step_range_end)
880 {
881 stop_print_frame = 0;
882 stop_stack_dummy = 1;
bd5635a1 883#ifdef HP_OS_BUG
c9de302b 884 trap_expected_after_continue = 1;
bd5635a1 885#endif
c9de302b
SG
886 break;
887 }
84d59861
JK
888#endif /* No CALL_DUMMY_BREAKPOINT_OFFSET. */
889
fe675038 890 if (step_resume_breakpoint)
bd5635a1
RP
891 /* Having a step-resume breakpoint overrides anything
892 else having to do with stepping commands until
893 that breakpoint is reached. */
fe675038
JK
894 /* I suspect this could/should be keep_going, because if the
895 check_sigtramp2 check succeeds, then it will put in another
896 step_resume_breakpoint, and we aren't (yet) prepared to nest
897 them. */
898 goto check_sigtramp2;
899
900 if (step_range_end == 0)
901 /* Likewise if we aren't even stepping. */
902 /* I'm not sure whether this needs to be check_sigtramp2 or
903 whether it could/should be keep_going. */
904 goto check_sigtramp2;
905
bd5635a1 906 /* If stepping through a line, keep going if still within it. */
fe675038
JK
907 if (stop_pc >= step_range_start
908 && stop_pc < step_range_end
909 /* The step range might include the start of the
910 function, so if we are at the start of the
911 step range and either the stack or frame pointers
912 just changed, we've stepped outside */
913 && !(stop_pc == step_range_start
914 && stop_frame_address
915 && (stop_sp INNER_THAN prev_sp
916 || stop_frame_address != step_frame_address)))
bd5635a1 917 {
fe675038
JK
918 /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
919 So definately need to check for sigtramp here. */
920 goto check_sigtramp2;
bd5635a1 921 }
fe675038 922
bd5635a1
RP
923 /* We stepped out of the stepping range. See if that was due
924 to a subroutine call that we should proceed to the end of. */
fe675038
JK
925
926 /* Did we just take a signal? */
927 if (IN_SIGTRAMP (stop_pc, stop_func_name)
928 && !IN_SIGTRAMP (prev_pc, prev_func_name))
bd5635a1 929 {
fe675038
JK
930 /* This code is needed at least in the following case:
931 The user types "next" and then a signal arrives (before
932 the "next" is done). */
933 /* We've just taken a signal; go until we are back to
934 the point where we took it and one more. */
935 {
936 struct symtab_and_line sr_sal;
937
938 sr_sal.pc = prev_pc;
939 sr_sal.symtab = NULL;
940 sr_sal.line = 0;
941 step_resume_breakpoint =
942 set_momentary_breakpoint (sr_sal, get_current_frame (),
943 bp_step_resume);
944 if (breakpoints_inserted)
945 insert_breakpoints ();
946 }
bd5635a1 947
fe675038
JK
948 /* If this is stepi or nexti, make sure that the stepping range
949 gets us past that instruction. */
950 if (step_range_end == 1)
951 /* FIXME: Does this run afoul of the code below which, if
952 we step into the middle of a line, resets the stepping
953 range? */
954 step_range_end = (step_range_start = prev_pc) + 1;
101b7f9c 955
fe675038
JK
956 remove_breakpoints_on_following_step = 1;
957 goto keep_going;
958 }
30875e1c 959
fe675038
JK
960 if (stop_func_start)
961 {
962 /* Do this after the IN_SIGTRAMP check; it might give
963 an error. */
964 prologue_pc = stop_func_start;
965 SKIP_PROLOGUE (prologue_pc);
966 }
30875e1c 967
c0c14c1e
JK
968 if ((/* Might be a non-recursive call. If the symbols are missing
969 enough that stop_func_start == prev_func_start even though
970 they are really two functions, we will treat some calls as
971 jumps. */
972 stop_func_start != prev_func_start
973
974 /* Might be a recursive call if either we have a prologue
975 or the call instruction itself saves the PC on the stack. */
976 || prologue_pc != stop_func_start
977 || stop_sp != prev_sp)
199b2450
TL
978 && (/* PC is completely out of bounds of any known objfiles. Treat
979 like a subroutine call. */
980 ! stop_func_start
c0c14c1e 981
f1619234 982 /* If we do a call, we will be at the start of a function... */
c0c14c1e 983 || stop_pc == stop_func_start
f1619234
JK
984#if 0
985 /* Should be taken care of by the stop_pc < prologue_pc check
986 below. Also, on irix5 where this checks for stop_pc
987 equal to stop_func_start plus 12, it would seem to be
988 wrong for a function with a 4 byte prologue, and an 8 byte
989 call; a "return" could end up at stop_func_start+12. */
990
b2f03c30 991 || AT_FUNCTION_START (stop_pc, stop_func_name, stop_func_start)
f1619234
JK
992#endif
993
994 /* ...except on the Alpha with -O (and also Irix 5 and
995 perhaps others), in which we might call the address
996 after the load of gp. Since prologues don't contain
997 calls, we can't return to within one, and we don't
998 jump back into them, so this check is OK. */
c0c14c1e 999
c0c14c1e 1000 || stop_pc < prologue_pc
d747e0af 1001
c0c14c1e
JK
1002 /* If we end up in certain places, it means we did a subroutine
1003 call. I'm not completely sure this is necessary now that we
1004 have the above checks with stop_func_start (and now that
100f92e2 1005 find_pc_partial_function is pickier). */
c0c14c1e
JK
1006 || IN_SOLIB_TRAMPOLINE (stop_pc, stop_func_name)
1007
1008 /* If none of the above apply, it is a jump within a function,
1009 or a return from a subroutine. The other case is longjmp,
1010 which can no longer happen here as long as the
1011 handling_longjmp stuff is working. */
1012 ))
fe675038
JK
1013 {
1014 /* It's a subroutine call. */
fee44494 1015
fe675038
JK
1016 if (step_over_calls == 0)
1017 {
1018 /* I presume that step_over_calls is only 0 when we're
1019 supposed to be stepping at the assembly language level
1020 ("stepi"). Just stop. */
1021 stop_step = 1;
1022 break;
1023 }
fee44494 1024
fe675038
JK
1025 if (step_over_calls > 0)
1026 /* We're doing a "next". */
1027 goto step_over_function;
1028
1029 /* If we are in a function call trampoline (a stub between
1030 the calling routine and the real function), locate the real
1031 function. That's what tells us (a) whether we want to step
1032 into it at all, and (b) what prologue we want to run to
1033 the end of, if we do step into it. */
1034 tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
1035 if (tmp != 0)
1036 stop_func_start = tmp;
1037
1038 /* If we have line number information for the function we
1039 are thinking of stepping into, step into it.
1040
1041 If there are several symtabs at that PC (e.g. with include
1042 files), just want to know whether *any* of them have line
1043 numbers. find_pc_line handles this. */
1044 {
1045 struct symtab_and_line tmp_sal;
1046
1047 tmp_sal = find_pc_line (stop_func_start, 0);
1048 if (tmp_sal.line != 0)
1049 goto step_into_function;
1050 }
d747e0af
MT
1051
1052step_over_function:
fe675038
JK
1053 /* A subroutine call has happened. */
1054 {
1055 /* Set a special breakpoint after the return */
1056 struct symtab_and_line sr_sal;
1057 sr_sal.pc =
1058 ADDR_BITS_REMOVE
1059 (SAVED_PC_AFTER_CALL (get_current_frame ()));
1060 sr_sal.symtab = NULL;
1061 sr_sal.line = 0;
1062 step_resume_breakpoint =
1063 set_momentary_breakpoint (sr_sal, get_current_frame (),
1064 bp_step_resume);
1065 if (breakpoints_inserted)
1066 insert_breakpoints ();
1067 }
1068 goto keep_going;
d747e0af
MT
1069
1070step_into_function:
fe675038
JK
1071 /* Subroutine call with source code we should not step over.
1072 Do step to the first line of code in it. */
1073 SKIP_PROLOGUE (stop_func_start);
1074 sal = find_pc_line (stop_func_start, 0);
1075 /* Use the step_resume_break to step until
1076 the end of the prologue, even if that involves jumps
1077 (as it seems to on the vax under 4.2). */
1078 /* If the prologue ends in the middle of a source line,
67ac9759
JK
1079 continue to the end of that source line (if it is still
1080 within the function). Otherwise, just go to end of prologue. */
bd5635a1 1081#ifdef PROLOGUE_FIRSTLINE_OVERLAP
fe675038
JK
1082 /* no, don't either. It skips any code that's
1083 legitimately on the first line. */
bd5635a1 1084#else
67ac9759 1085 if (sal.end && sal.pc != stop_func_start && sal.end < stop_func_end)
fe675038 1086 stop_func_start = sal.end;
bd5635a1 1087#endif
d747e0af 1088
fe675038
JK
1089 if (stop_func_start == stop_pc)
1090 {
1091 /* We are already there: stop now. */
1092 stop_step = 1;
1093 break;
1094 }
1095 else
1096 /* Put the step-breakpoint there and go until there. */
1097 {
1098 struct symtab_and_line sr_sal;
1099
1100 sr_sal.pc = stop_func_start;
1101 sr_sal.symtab = NULL;
1102 sr_sal.line = 0;
1103 /* Do not specify what the fp should be when we stop
1104 since on some machines the prologue
1105 is where the new fp value is established. */
1106 step_resume_breakpoint =
84d59861 1107 set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
fe675038
JK
1108 if (breakpoints_inserted)
1109 insert_breakpoints ();
1110
1111 /* And make sure stepping stops right away then. */
1112 step_range_end = step_range_start;
bd5635a1 1113 }
fe675038
JK
1114 goto keep_going;
1115 }
d747e0af 1116
b2f03c30 1117 /* We've wandered out of the step range. */
d747e0af 1118
fe675038
JK
1119 sal = find_pc_line(stop_pc, 0);
1120
1121 if (step_range_end == 1)
1122 {
1123 /* It is stepi or nexti. We always want to stop stepping after
1124 one instruction. */
1125 stop_step = 1;
1126 break;
1127 }
1128
1129 if (sal.line == 0)
1130 {
1131 /* We have no line number information. That means to stop
1132 stepping (does this always happen right after one instruction,
1133 when we do "s" in a function with no line numbers,
1134 or can this happen as a result of a return or longjmp?). */
1135 stop_step = 1;
1136 break;
1137 }
1138
b2f03c30
JK
1139 if (stop_pc == sal.pc
1140 && (current_line != sal.line || current_symtab != sal.symtab))
fe675038
JK
1141 {
1142 /* We are at the start of a different line. So stop. Note that
1143 we don't stop if we step into the middle of a different line.
1144 That is said to make things like for (;;) statements work
1145 better. */
1146 stop_step = 1;
1147 break;
bd5635a1
RP
1148 }
1149
fe675038
JK
1150 /* We aren't done stepping.
1151
1152 Optimize by setting the stepping range to the line.
1153 (We might not be in the original line, but if we entered a
1154 new line in mid-statement, we continue stepping. This makes
1155 things like for(;;) statements work better.) */
67ac9759
JK
1156
1157 if (stop_func_end && sal.end >= stop_func_end)
1158 {
1159 /* If this is the last line of the function, don't keep stepping
1160 (it would probably step us out of the function).
1161 This is particularly necessary for a one-line function,
1162 in which after skipping the prologue we better stop even though
1163 we will be in mid-line. */
1164 stop_step = 1;
1165 break;
1166 }
fe675038
JK
1167 step_range_start = sal.pc;
1168 step_range_end = sal.end;
1169 goto keep_going;
1170
1171 check_sigtramp2:
d747e0af
MT
1172 if (trap_expected
1173 && IN_SIGTRAMP (stop_pc, stop_func_name)
1174 && !IN_SIGTRAMP (prev_pc, prev_func_name))
bd5635a1
RP
1175 {
1176 /* What has happened here is that we have just stepped the inferior
1177 with a signal (because it is a signal which shouldn't make
1178 us stop), thus stepping into sigtramp.
1179
1180 So we need to set a step_resume_break_address breakpoint
fe675038
JK
1181 and continue until we hit it, and then step. FIXME: This should
1182 be more enduring than a step_resume breakpoint; we should know
1183 that we will later need to keep going rather than re-hitting
1184 the breakpoint here (see testsuite/gdb.t06/signals.exp where
1185 it says "exceedingly difficult"). */
1186 struct symtab_and_line sr_sal;
1187
1188 sr_sal.pc = prev_pc;
1189 sr_sal.symtab = NULL;
1190 sr_sal.line = 0;
1191 step_resume_breakpoint =
1192 set_momentary_breakpoint (sr_sal, get_current_frame (),
1193 bp_step_resume);
bd5635a1 1194 if (breakpoints_inserted)
fe675038
JK
1195 insert_breakpoints ();
1196
bd5635a1
RP
1197 remove_breakpoints_on_following_step = 1;
1198 another_trap = 1;
1199 }
1200
30875e1c 1201 keep_going:
fe675038
JK
1202 /* Come to this label when you need to resume the inferior.
1203 It's really much cleaner to do a goto than a maze of if-else
1204 conditions. */
30875e1c 1205
bd5635a1
RP
1206 /* Save the pc before execution, to compare with pc after stop. */
1207 prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
1208 prev_func_start = stop_func_start; /* Ok, since if DECR_PC_AFTER
1209 BREAK is defined, the
1210 original pc would not have
1211 been at the start of a
1212 function. */
1213 prev_func_name = stop_func_name;
1214 prev_sp = stop_sp;
1215
1216 /* If we did not do break;, it means we should keep
1217 running the inferior and not return to debugger. */
1218
67ac9759 1219 if (trap_expected && stop_signal != TARGET_SIGNAL_TRAP)
bd5635a1
RP
1220 {
1221 /* We took a signal (which we are supposed to pass through to
1222 the inferior, else we'd have done a break above) and we
1223 haven't yet gotten our trap. Simply continue. */
cb6b0202 1224 resume (CURRENTLY_STEPPING (), stop_signal);
bd5635a1
RP
1225 }
1226 else
1227 {
1228 /* Either the trap was not expected, but we are continuing
1229 anyway (the user asked that this signal be passed to the
1230 child)
1231 -- or --
1232 The signal was SIGTRAP, e.g. it was our signal, but we
1233 decided we should resume from it.
1234
1235 We're going to run this baby now!
1236
1237 Insert breakpoints now, unless we are trying
1238 to one-proceed past a breakpoint. */
1239 /* If we've just finished a special step resume and we don't
1240 want to hit a breakpoint, pull em out. */
fe675038 1241 if (step_resume_breakpoint == NULL &&
bd5635a1
RP
1242 remove_breakpoints_on_following_step)
1243 {
1244 remove_breakpoints_on_following_step = 0;
1245 remove_breakpoints ();
1246 breakpoints_inserted = 0;
1247 }
1248 else if (!breakpoints_inserted &&
fe675038 1249 (step_resume_breakpoint != NULL || !another_trap))
bd5635a1 1250 {
bd5635a1
RP
1251 breakpoints_failed = insert_breakpoints ();
1252 if (breakpoints_failed)
1253 break;
1254 breakpoints_inserted = 1;
1255 }
1256
1257 trap_expected = another_trap;
1258
67ac9759
JK
1259 if (stop_signal == TARGET_SIGNAL_TRAP)
1260 stop_signal = TARGET_SIGNAL_0;
bd5635a1
RP
1261
1262#ifdef SHIFT_INST_REGS
1263 /* I'm not sure when this following segment applies. I do know, now,
1264 that we shouldn't rewrite the regs when we were stopped by a
1265 random signal from the inferior process. */
cef4c2e7
PS
1266 /* FIXME: Shouldn't this be based on the valid bit of the SXIP?
1267 (this is only used on the 88k). */
bd5635a1 1268
d11c44f1 1269 if (!bpstat_explains_signal (stop_bpstat)
67ac9759 1270 && (stop_signal != TARGET_SIGNAL_CHLD)
bd5635a1 1271 && !stopped_by_random_signal)
07a5991a 1272 SHIFT_INST_REGS();
bd5635a1
RP
1273#endif /* SHIFT_INST_REGS */
1274
cb6b0202 1275 resume (CURRENTLY_STEPPING (), stop_signal);
bd5635a1
RP
1276 }
1277 }
30875e1c
SG
1278
1279 stop_stepping:
bd5635a1
RP
1280 if (target_has_execution)
1281 {
1282 /* Assuming the inferior still exists, set these up for next
1283 time, just like we did above if we didn't break out of the
1284 loop. */
1285 prev_pc = read_pc ();
1286 prev_func_start = stop_func_start;
1287 prev_func_name = stop_func_name;
1288 prev_sp = stop_sp;
1289 }
fe675038 1290 do_cleanups (old_cleanups);
bd5635a1
RP
1291}
1292\f
1293/* Here to return control to GDB when the inferior stops for real.
1294 Print appropriate messages, remove breakpoints, give terminal our modes.
1295
1296 STOP_PRINT_FRAME nonzero means print the executing frame
1297 (pc, function, args, file, line number and line text).
1298 BREAKPOINTS_FAILED nonzero means stop was due to error
1299 attempting to insert breakpoints. */
1300
1301void
1302normal_stop ()
1303{
1304 /* Make sure that the current_frame's pc is correct. This
1305 is a correction for setting up the frame info before doing
1306 DECR_PC_AFTER_BREAK */
3f0184ac 1307 if (target_has_execution && get_current_frame())
bd5635a1
RP
1308 (get_current_frame ())->pc = read_pc ();
1309
1310 if (breakpoints_failed)
1311 {
1312 target_terminal_ours_for_output ();
1313 print_sys_errmsg ("ptrace", breakpoints_failed);
e37a6e9c 1314 printf_filtered ("Stopped; cannot insert breakpoints.\n\
bd5635a1
RP
1315The same program may be running in another process.\n");
1316 }
1317
bd5635a1
RP
1318 if (target_has_execution && breakpoints_inserted)
1319 if (remove_breakpoints ())
1320 {
1321 target_terminal_ours_for_output ();
e37a6e9c 1322 printf_filtered ("Cannot remove breakpoints because program is no longer writable.\n\
bd5635a1
RP
1323It might be running in another process.\n\
1324Further execution is probably impossible.\n");
1325 }
1326
1327 breakpoints_inserted = 0;
1328
1329 /* Delete the breakpoint we stopped at, if it wants to be deleted.
1330 Delete any breakpoint that is to be deleted at the next stop. */
1331
1332 breakpoint_auto_delete (stop_bpstat);
1333
1334 /* If an auto-display called a function and that got a signal,
1335 delete that auto-display to avoid an infinite recursion. */
1336
1337 if (stopped_by_random_signal)
1338 disable_current_display ();
1339
1340 if (step_multi && stop_step)
1341 return;
1342
1343 target_terminal_ours ();
1344
3950a34e
RP
1345 /* Look up the hook_stop and run it if it exists. */
1346
1347 if (stop_command->hook)
1348 {
1349 catch_errors (hook_stop_stub, (char *)stop_command->hook,
fee44494 1350 "Error while running hook_stop:\n", RETURN_MASK_ALL);
3950a34e
RP
1351 }
1352
bd5635a1
RP
1353 if (!target_has_stack)
1354 return;
1355
1356 /* Select innermost stack frame except on return from a stack dummy routine,
1515ff18
JG
1357 or if the program has exited. Print it without a level number if
1358 we have changed functions or hit a breakpoint. Print source line
1359 if we have one. */
bd5635a1
RP
1360 if (!stop_stack_dummy)
1361 {
1362 select_frame (get_current_frame (), 0);
1363
1364 if (stop_print_frame)
1365 {
1515ff18
JG
1366 int source_only;
1367
1368 source_only = bpstat_print (stop_bpstat);
1369 source_only = source_only ||
1370 ( stop_step
bd5635a1 1371 && step_frame_address == stop_frame_address
1515ff18
JG
1372 && step_start_function == find_pc_function (stop_pc));
1373
1374 print_stack_frame (selected_frame, -1, source_only? -1: 1);
bd5635a1
RP
1375
1376 /* Display the auto-display expressions. */
1377 do_displays ();
1378 }
1379 }
1380
1381 /* Save the function value return registers, if we care.
1382 We might be about to restore their previous contents. */
1383 if (proceed_to_finish)
1384 read_register_bytes (0, stop_registers, REGISTER_BYTES);
1385
1386 if (stop_stack_dummy)
1387 {
1388 /* Pop the empty frame that contains the stack dummy.
1389 POP_FRAME ends with a setting of the current frame, so we
1390 can use that next. */
1391 POP_FRAME;
1392 select_frame (get_current_frame (), 0);
1393 }
1394}
3950a34e
RP
1395
1396static int
1397hook_stop_stub (cmd)
1398 char *cmd;
1399{
1400 execute_user_command ((struct cmd_list_element *)cmd, 0);
a8a69e63 1401 return (0);
3950a34e 1402}
bd5635a1 1403\f
cc221e76
FF
1404int signal_stop_state (signo)
1405 int signo;
1406{
67ac9759 1407 return signal_stop[signo];
cc221e76
FF
1408}
1409
1410int signal_print_state (signo)
1411 int signo;
1412{
67ac9759 1413 return signal_print[signo];
cc221e76
FF
1414}
1415
1416int signal_pass_state (signo)
1417 int signo;
1418{
67ac9759 1419 return signal_program[signo];
cc221e76
FF
1420}
1421
bd5635a1
RP
1422static void
1423sig_print_header ()
1424{
67ac9759
JK
1425 printf_filtered ("\
1426Signal Stop\tPrint\tPass to program\tDescription\n");
bd5635a1
RP
1427}
1428
1429static void
67ac9759
JK
1430sig_print_info (oursig)
1431 enum target_signal oursig;
bd5635a1 1432{
67ac9759
JK
1433 char *name = target_signal_to_name (oursig);
1434 printf_filtered ("%s", name);
1435 printf_filtered ("%*.*s ", 13 - strlen (name), 13 - strlen (name),
1436 " ");
1437 printf_filtered ("%s\t", signal_stop[oursig] ? "Yes" : "No");
1438 printf_filtered ("%s\t", signal_print[oursig] ? "Yes" : "No");
1439 printf_filtered ("%s\t\t", signal_program[oursig] ? "Yes" : "No");
1440 printf_filtered ("%s\n", target_signal_to_string (oursig));
bd5635a1
RP
1441}
1442
1443/* Specify how various signals in the inferior should be handled. */
1444
1445static void
1446handle_command (args, from_tty)
1447 char *args;
1448 int from_tty;
1449{
072b552a
JG
1450 char **argv;
1451 int digits, wordlen;
1452 int sigfirst, signum, siglast;
67ac9759 1453 enum target_signal oursig;
072b552a
JG
1454 int allsigs;
1455 int nsigs;
1456 unsigned char *sigs;
1457 struct cleanup *old_chain;
1458
1459 if (args == NULL)
1460 {
1461 error_no_arg ("signal to handle");
1462 }
bd5635a1 1463
072b552a
JG
1464 /* Allocate and zero an array of flags for which signals to handle. */
1465
67ac9759 1466 nsigs = (int)TARGET_SIGNAL_LAST;
072b552a
JG
1467 sigs = (unsigned char *) alloca (nsigs);
1468 memset (sigs, 0, nsigs);
bd5635a1 1469
072b552a
JG
1470 /* Break the command line up into args. */
1471
1472 argv = buildargv (args);
1473 if (argv == NULL)
bd5635a1 1474 {
072b552a
JG
1475 nomem (0);
1476 }
1477 old_chain = make_cleanup (freeargv, (char *) argv);
bd5635a1 1478
67ac9759 1479 /* Walk through the args, looking for signal oursigs, signal names, and
072b552a
JG
1480 actions. Signal numbers and signal names may be interspersed with
1481 actions, with the actions being performed for all signals cumulatively
1482 specified. Signal ranges can be specified as <LOW>-<HIGH>. */
bd5635a1 1483
072b552a
JG
1484 while (*argv != NULL)
1485 {
1486 wordlen = strlen (*argv);
1487 for (digits = 0; isdigit ((*argv)[digits]); digits++) {;}
1488 allsigs = 0;
1489 sigfirst = siglast = -1;
1490
1491 if (wordlen >= 1 && !strncmp (*argv, "all", wordlen))
1492 {
1493 /* Apply action to all signals except those used by the
1494 debugger. Silently skip those. */
1495 allsigs = 1;
1496 sigfirst = 0;
1497 siglast = nsigs - 1;
1498 }
1499 else if (wordlen >= 1 && !strncmp (*argv, "stop", wordlen))
1500 {
1501 SET_SIGS (nsigs, sigs, signal_stop);
1502 SET_SIGS (nsigs, sigs, signal_print);
1503 }
1504 else if (wordlen >= 1 && !strncmp (*argv, "ignore", wordlen))
1505 {
1506 UNSET_SIGS (nsigs, sigs, signal_program);
1507 }
1508 else if (wordlen >= 2 && !strncmp (*argv, "print", wordlen))
1509 {
1510 SET_SIGS (nsigs, sigs, signal_print);
1511 }
1512 else if (wordlen >= 2 && !strncmp (*argv, "pass", wordlen))
1513 {
1514 SET_SIGS (nsigs, sigs, signal_program);
1515 }
1516 else if (wordlen >= 3 && !strncmp (*argv, "nostop", wordlen))
1517 {
1518 UNSET_SIGS (nsigs, sigs, signal_stop);
1519 }
1520 else if (wordlen >= 3 && !strncmp (*argv, "noignore", wordlen))
1521 {
1522 SET_SIGS (nsigs, sigs, signal_program);
1523 }
1524 else if (wordlen >= 4 && !strncmp (*argv, "noprint", wordlen))
1525 {
1526 UNSET_SIGS (nsigs, sigs, signal_print);
1527 UNSET_SIGS (nsigs, sigs, signal_stop);
1528 }
1529 else if (wordlen >= 4 && !strncmp (*argv, "nopass", wordlen))
1530 {
1531 UNSET_SIGS (nsigs, sigs, signal_program);
1532 }
1533 else if (digits > 0)
bd5635a1 1534 {
67ac9759
JK
1535 /* It is numeric. The numeric signal refers to our own internal
1536 signal numbering from target.h, not to host/target signal number.
1537 This is a feature; users really should be using symbolic names
1538 anyway, and the common ones like SIGHUP, SIGINT, SIGALRM, etc.
1539 will work right anyway. */
1540
072b552a
JG
1541 sigfirst = siglast = atoi (*argv);
1542 if ((*argv)[digits] == '-')
bd5635a1 1543 {
072b552a 1544 siglast = atoi ((*argv) + digits + 1);
bd5635a1 1545 }
072b552a 1546 if (sigfirst > siglast)
bd5635a1 1547 {
072b552a
JG
1548 /* Bet he didn't figure we'd think of this case... */
1549 signum = sigfirst;
1550 sigfirst = siglast;
1551 siglast = signum;
bd5635a1 1552 }
072b552a
JG
1553 if (sigfirst < 0 || sigfirst >= nsigs)
1554 {
1555 error ("Signal %d not in range 0-%d", sigfirst, nsigs - 1);
1556 }
1557 if (siglast < 0 || siglast >= nsigs)
bd5635a1 1558 {
072b552a 1559 error ("Signal %d not in range 0-%d", siglast, nsigs - 1);
bd5635a1
RP
1560 }
1561 }
67ac9759
JK
1562 else if ((oursig = target_signal_from_name (*argv))
1563 != TARGET_SIGNAL_UNKNOWN)
bd5635a1 1564 {
67ac9759 1565 sigfirst = siglast = (int)oursig;
bd5635a1 1566 }
072b552a 1567 else
bd5635a1 1568 {
072b552a
JG
1569 /* Not a number and not a recognized flag word => complain. */
1570 error ("Unrecognized or ambiguous flag word: \"%s\".", *argv);
bd5635a1 1571 }
072b552a
JG
1572
1573 /* If any signal numbers or symbol names were found, set flags for
1574 which signals to apply actions to. */
1575
1576 for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
bd5635a1 1577 {
67ac9759 1578 switch ((enum target_signal)signum)
072b552a 1579 {
67ac9759
JK
1580 case TARGET_SIGNAL_TRAP:
1581 case TARGET_SIGNAL_INT:
072b552a
JG
1582 if (!allsigs && !sigs[signum])
1583 {
67ac9759
JK
1584 if (query ("%s is used by the debugger.\n\
1585Are you sure you want to change it? ",
1586 target_signal_to_name
1587 ((enum target_signal)signum)))
072b552a
JG
1588 {
1589 sigs[signum] = 1;
1590 }
1591 else
1592 {
199b2450
TL
1593 printf_unfiltered ("Not confirmed, unchanged.\n");
1594 gdb_flush (gdb_stdout);
072b552a
JG
1595 }
1596 }
1597 break;
1598 default:
1599 sigs[signum] = 1;
1600 break;
1601 }
bd5635a1
RP
1602 }
1603
072b552a 1604 argv++;
bd5635a1
RP
1605 }
1606
de43d7d0 1607 target_notice_signals(inferior_pid);
cc221e76 1608
bd5635a1
RP
1609 if (from_tty)
1610 {
1611 /* Show the results. */
1612 sig_print_header ();
072b552a
JG
1613 for (signum = 0; signum < nsigs; signum++)
1614 {
1615 if (sigs[signum])
1616 {
1617 sig_print_info (signum);
1618 }
1619 }
bd5635a1 1620 }
072b552a
JG
1621
1622 do_cleanups (old_chain);
bd5635a1
RP
1623}
1624
67ac9759
JK
1625/* Print current contents of the tables set by the handle command.
1626 It is possible we should just be printing signals actually used
1627 by the current target (but for things to work right when switching
1628 targets, all signals should be in the signal tables). */
bd5635a1
RP
1629
1630static void
e37a6e9c 1631signals_info (signum_exp, from_tty)
bd5635a1 1632 char *signum_exp;
e37a6e9c 1633 int from_tty;
bd5635a1 1634{
67ac9759 1635 enum target_signal oursig;
bd5635a1
RP
1636 sig_print_header ();
1637
1638 if (signum_exp)
1639 {
1640 /* First see if this is a symbol name. */
67ac9759
JK
1641 oursig = target_signal_from_name (signum_exp);
1642 if (oursig == TARGET_SIGNAL_UNKNOWN)
bd5635a1
RP
1643 {
1644 /* Nope, maybe it's an address which evaluates to a signal
1645 number. */
67ac9759
JK
1646 /* The numeric signal refers to our own internal
1647 signal numbering from target.h, not to host/target signal number.
1648 This is a feature; users really should be using symbolic names
1649 anyway, and the common ones like SIGHUP, SIGINT, SIGALRM, etc.
1650 will work right anyway. */
1651 int i = parse_and_eval_address (signum_exp);
1652 if (i >= (int)TARGET_SIGNAL_LAST
1653 || i < 0
1654 || i == TARGET_SIGNAL_UNKNOWN)
bd5635a1 1655 error ("Signal number out of bounds.");
67ac9759 1656 oursig = (enum target_signal)i;
bd5635a1 1657 }
67ac9759 1658 sig_print_info (oursig);
bd5635a1
RP
1659 return;
1660 }
1661
1662 printf_filtered ("\n");
67ac9759 1663 for (oursig = 0; oursig < TARGET_SIGNAL_LAST; ++oursig)
bd5635a1
RP
1664 {
1665 QUIT;
1666
67ac9759
JK
1667 if (oursig != TARGET_SIGNAL_UNKNOWN)
1668 sig_print_info (oursig);
bd5635a1
RP
1669 }
1670
1671 printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
1672}
1673\f
1674/* Save all of the information associated with the inferior<==>gdb
1675 connection. INF_STATUS is a pointer to a "struct inferior_status"
1676 (defined in inferior.h). */
1677
1678void
1679save_inferior_status (inf_status, restore_stack_info)
1680 struct inferior_status *inf_status;
1681 int restore_stack_info;
1682{
bd5635a1
RP
1683 inf_status->stop_signal = stop_signal;
1684 inf_status->stop_pc = stop_pc;
1685 inf_status->stop_frame_address = stop_frame_address;
1686 inf_status->stop_step = stop_step;
1687 inf_status->stop_stack_dummy = stop_stack_dummy;
1688 inf_status->stopped_by_random_signal = stopped_by_random_signal;
1689 inf_status->trap_expected = trap_expected;
1690 inf_status->step_range_start = step_range_start;
1691 inf_status->step_range_end = step_range_end;
1692 inf_status->step_frame_address = step_frame_address;
1693 inf_status->step_over_calls = step_over_calls;
bd5635a1
RP
1694 inf_status->stop_after_trap = stop_after_trap;
1695 inf_status->stop_soon_quietly = stop_soon_quietly;
1696 /* Save original bpstat chain here; replace it with copy of chain.
1697 If caller's caller is walking the chain, they'll be happier if we
1698 hand them back the original chain when restore_i_s is called. */
1699 inf_status->stop_bpstat = stop_bpstat;
1700 stop_bpstat = bpstat_copy (stop_bpstat);
1701 inf_status->breakpoint_proceeded = breakpoint_proceeded;
1702 inf_status->restore_stack_info = restore_stack_info;
1703 inf_status->proceed_to_finish = proceed_to_finish;
1704
072b552a 1705 memcpy (inf_status->stop_registers, stop_registers, REGISTER_BYTES);
37c99ddb
JK
1706
1707 read_register_bytes (0, inf_status->registers, REGISTER_BYTES);
1708
bd5635a1
RP
1709 record_selected_frame (&(inf_status->selected_frame_address),
1710 &(inf_status->selected_level));
1711 return;
1712}
1713
37c99ddb
JK
1714struct restore_selected_frame_args {
1715 FRAME_ADDR frame_address;
1716 int level;
1717};
1718
1719static int restore_selected_frame PARAMS ((char *));
1720
1721/* Restore the selected frame. args is really a struct
1722 restore_selected_frame_args * (declared as char * for catch_errors)
1723 telling us what frame to restore. Returns 1 for success, or 0 for
1724 failure. An error message will have been printed on error. */
1725static int
1726restore_selected_frame (args)
1727 char *args;
1728{
1729 struct restore_selected_frame_args *fr =
1730 (struct restore_selected_frame_args *) args;
1731 FRAME fid;
1732 int level = fr->level;
1733
1734 fid = find_relative_frame (get_current_frame (), &level);
1735
1736 /* If inf_status->selected_frame_address is NULL, there was no
1737 previously selected frame. */
1738 if (fid == 0 ||
1739 FRAME_FP (fid) != fr->frame_address ||
1740 level != 0)
1741 {
1742 warning ("Unable to restore previously selected frame.\n");
1743 return 0;
1744 }
1745 select_frame (fid, fr->level);
1746 return(1);
1747}
1748
bd5635a1
RP
1749void
1750restore_inferior_status (inf_status)
1751 struct inferior_status *inf_status;
1752{
bd5635a1
RP
1753 stop_signal = inf_status->stop_signal;
1754 stop_pc = inf_status->stop_pc;
1755 stop_frame_address = inf_status->stop_frame_address;
1756 stop_step = inf_status->stop_step;
1757 stop_stack_dummy = inf_status->stop_stack_dummy;
1758 stopped_by_random_signal = inf_status->stopped_by_random_signal;
1759 trap_expected = inf_status->trap_expected;
1760 step_range_start = inf_status->step_range_start;
1761 step_range_end = inf_status->step_range_end;
1762 step_frame_address = inf_status->step_frame_address;
1763 step_over_calls = inf_status->step_over_calls;
bd5635a1
RP
1764 stop_after_trap = inf_status->stop_after_trap;
1765 stop_soon_quietly = inf_status->stop_soon_quietly;
1766 bpstat_clear (&stop_bpstat);
1767 stop_bpstat = inf_status->stop_bpstat;
1768 breakpoint_proceeded = inf_status->breakpoint_proceeded;
1769 proceed_to_finish = inf_status->proceed_to_finish;
1770
072b552a 1771 memcpy (stop_registers, inf_status->stop_registers, REGISTER_BYTES);
bd5635a1
RP
1772
1773 /* The inferior can be gone if the user types "print exit(0)"
1774 (and perhaps other times). */
37c99ddb
JK
1775 if (target_has_execution)
1776 write_register_bytes (0, inf_status->registers, REGISTER_BYTES);
1777
1778 /* The inferior can be gone if the user types "print exit(0)"
1779 (and perhaps other times). */
1780
1781 /* FIXME: If we are being called after stopping in a function which
1782 is called from gdb, we should not be trying to restore the
1783 selected frame; it just prints a spurious error message (The
1784 message is useful, however, in detecting bugs in gdb (like if gdb
1785 clobbers the stack)). In fact, should we be restoring the
1786 inferior status at all in that case? . */
1787
bd5635a1
RP
1788 if (target_has_stack && inf_status->restore_stack_info)
1789 {
37c99ddb
JK
1790 struct restore_selected_frame_args fr;
1791 fr.level = inf_status->selected_level;
1792 fr.frame_address = inf_status->selected_frame_address;
1793 /* The point of catch_errors is that if the stack is clobbered,
1794 walking the stack might encounter a garbage pointer and error()
1795 trying to dereference it. */
1796 if (catch_errors (restore_selected_frame, &fr,
1797 "Unable to restore previously selected frame:\n",
1798 RETURN_MASK_ERROR) == 0)
1799 /* Error in restoring the selected frame. Select the innermost
1800 frame. */
1801 select_frame (get_current_frame (), 0);
bd5635a1
RP
1802 }
1803}
1804
1805\f
1806void
1807_initialize_infrun ()
1808{
1809 register int i;
e37a6e9c 1810 register int numsigs;
bd5635a1
RP
1811
1812 add_info ("signals", signals_info,
1813 "What debugger does when program gets various signals.\n\
1814Specify a signal number as argument to print info on that signal only.");
6b50c5c2 1815 add_info_alias ("handle", "signals", 0);
bd5635a1
RP
1816
1817 add_com ("handle", class_run, handle_command,
1818 "Specify how to handle a signal.\n\
072b552a
JG
1819Args are signal numbers and actions to apply to those signals.\n\
1820Signal numbers may be numeric (ex. 11) or symbolic (ex. SIGSEGV).\n\
1821Numeric ranges may be specified with the form LOW-HIGH (ex. 14-21).\n\
1822The special arg \"all\" is recognized to mean all signals except those\n\
1823used by the debugger, typically SIGTRAP and SIGINT.\n\
1824Recognized actions include \"stop\", \"nostop\", \"print\", \"noprint\",\n\
1825\"pass\", \"nopass\", \"ignore\", or \"noignore\".\n\
bd5635a1 1826Stop means reenter debugger if this signal happens (implies print).\n\
072b552a 1827Print means print a message if this signal happens.\n\
bd5635a1 1828Pass means let program see this signal; otherwise program doesn't know.\n\
072b552a 1829Ignore is a synonym for nopass and noignore is a synonym for pass.\n\
bd5635a1
RP
1830Pass and Stop may be combined.");
1831
a8a69e63 1832 stop_command = add_cmd ("stop", class_obscure, not_just_help_class_command,
3950a34e
RP
1833 "There is no `stop' command, but you can set a hook on `stop'.\n\
1834This allows you to set a list of commands to be run each time execution\n\
fee44494 1835of the program stops.", &cmdlist);
3950a34e 1836
67ac9759
JK
1837 numsigs = (int)TARGET_SIGNAL_LAST;
1838 signal_stop = (unsigned char *)
1839 xmalloc (sizeof (signal_stop[0]) * numsigs);
1840 signal_print = (unsigned char *)
1841 xmalloc (sizeof (signal_print[0]) * numsigs);
072b552a 1842 signal_program = (unsigned char *)
67ac9759 1843 xmalloc (sizeof (signal_program[0]) * numsigs);
e37a6e9c 1844 for (i = 0; i < numsigs; i++)
bd5635a1
RP
1845 {
1846 signal_stop[i] = 1;
1847 signal_print[i] = 1;
1848 signal_program[i] = 1;
1849 }
1850
1851 /* Signals caused by debugger's own actions
1852 should not be given to the program afterwards. */
67ac9759
JK
1853 signal_program[TARGET_SIGNAL_TRAP] = 0;
1854 signal_program[TARGET_SIGNAL_INT] = 0;
bd5635a1
RP
1855
1856 /* Signals that are not errors should not normally enter the debugger. */
67ac9759
JK
1857 signal_stop[TARGET_SIGNAL_ALRM] = 0;
1858 signal_print[TARGET_SIGNAL_ALRM] = 0;
1859 signal_stop[TARGET_SIGNAL_VTALRM] = 0;
1860 signal_print[TARGET_SIGNAL_VTALRM] = 0;
1861 signal_stop[TARGET_SIGNAL_PROF] = 0;
1862 signal_print[TARGET_SIGNAL_PROF] = 0;
1863 signal_stop[TARGET_SIGNAL_CHLD] = 0;
1864 signal_print[TARGET_SIGNAL_CHLD] = 0;
1865 signal_stop[TARGET_SIGNAL_IO] = 0;
1866 signal_print[TARGET_SIGNAL_IO] = 0;
1867 signal_stop[TARGET_SIGNAL_URG] = 0;
1868 signal_print[TARGET_SIGNAL_URG] = 0;
bd5635a1 1869}
This page took 0.255856 seconds and 4 git commands to generate.