OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.base/] [signals.c] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.