1999-04-16 01:35:26 +00:00
|
|
|
/* Test GDB dealing with stuff like stepping into sigtramp. */
|
|
|
|
|
|
|
|
#include <signal.h>
|
1999-06-28 16:06:02 +00:00
|
|
|
#include <unistd.h>
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#ifdef __sh__
|
|
|
|
#define signal(a,b) /* Signals not supported on this target - make them go away */
|
|
|
|
#define alarm(a) /* Ditto for alarm() */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int count = 0;
|
|
|
|
|
1999-06-28 16:06:02 +00:00
|
|
|
#ifdef PROTOTYPES
|
|
|
|
static void
|
|
|
|
handler (int sig)
|
|
|
|
#else
|
1999-04-16 01:35:26 +00:00
|
|
|
static void
|
|
|
|
handler (sig)
|
|
|
|
int sig;
|
1999-06-28 16:06:02 +00:00
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
{
|
|
|
|
signal (sig, handler);
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
func1 ()
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
func2 ()
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
#ifdef usestubs
|
|
|
|
set_debug_traps();
|
|
|
|
breakpoint();
|
|
|
|
#endif
|
|
|
|
#ifdef SIGALRM
|
|
|
|
signal (SIGALRM, handler);
|
|
|
|
#endif
|
|
|
|
#ifdef SIGUSR1
|
|
|
|
signal (SIGUSR1, handler);
|
|
|
|
#endif
|
|
|
|
alarm (1);
|
|
|
|
++count; /* first */
|
|
|
|
alarm (1);
|
|
|
|
++count; /* second */
|
|
|
|
func1 ();
|
|
|
|
alarm (1);
|
|
|
|
func2 ();
|
|
|
|
return count;
|
|
|
|
}
|