1 /* Copyright (C) 2014-2016 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 /* NOP instruction: must have the same size as the breakpoint
27 #if defined(__s390__) || defined(__s390x__)
28 #define NOP asm("nopr 0")
30 #define NOP asm("nop")
33 /* Buffer holding the breakpoint instruction. */
34 unsigned char buffer
[16];
36 volatile unsigned char *addr_bp
;
37 volatile unsigned char *addr_after_bp
;
46 NOP
; /* write permanent bp here */
47 NOP
; /* after permanent bp */
60 memcpy (buffer
, (void *) addr_bp
, addr_after_bp
- addr_bp
);
66 test (); /* for SIGTRAP */
67 test (); /* for breakpoint once */
68 test (); /* for breakpoint twice */
69 test (); /* for disabled bp SIGTRAP */
70 test (); /* for breakpoint thrice */
76 test (); /* for next */
77 counter
= 0; /* after next */
83 test_signal_handler (int sig
)
88 test_signal_with_handler (void)
90 signal (SIGUSR1
, test_signal_handler
);
95 test_signal_no_handler (void)
97 signal (SIGUSR1
, SIG_IGN
);
102 test_signal_nested_handler ()
108 test_signal_nested_done (void)
113 test_signal_nested (void)
116 signal (SIGALRM
, test_signal_nested_handler
);
119 test_signal_nested_done ();
131 test_signal_nested ();
132 test_signal_with_handler ();
133 test_signal_no_handler ();