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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.base/] [call-signals.c] - Diff between revs 834 and 842

Only display areas with differences | Details | Blame | View Log

Rev 834 Rev 842
/* This testcase is part of GDB, the GNU debugger.
/* This testcase is part of GDB, the GNU debugger.
 
 
   Copyright 2008, 2010 Free Software Foundation, Inc.
   Copyright 2008, 2010 Free Software Foundation, Inc.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
/* Support program for testing handling of inferior function calls
/* Support program for testing handling of inferior function calls
   in the presence of signals.  */
   in the presence of signals.  */
 
 
#include <stdio.h>
#include <stdio.h>
#include <signal.h>
#include <signal.h>
#include <unistd.h>
#include <unistd.h>
 
 
void
void
handle_signal (int sig)
handle_signal (int sig)
{
{
}
}
 
 
void
void
gen_signal ()
gen_signal ()
{
{
  /* According to sigall.exp, SIGABRT is always supported.  */
  /* According to sigall.exp, SIGABRT is always supported.  */
#ifdef SIGABRT
#ifdef SIGABRT
  kill (getpid (), SIGABRT);
  kill (getpid (), SIGABRT);
#endif
#endif
  /* If we get here we couldn't generate a signal, tell dejagnu.  */
  /* If we get here we couldn't generate a signal, tell dejagnu.  */
  printf ("no signal\n");
  printf ("no signal\n");
}
}
 
 
/* Easy place to set a breakpoint.  */
/* Easy place to set a breakpoint.  */
 
 
void
void
stop_one ()
stop_one ()
{
{
}
}
 
 
void
void
stop_two ()
stop_two ()
{
{
}
}
 
 
void
void
null_hand_call ()
null_hand_call ()
{
{
}
}
 
 
int
int
main ()
main ()
{
{
#ifdef usestubs
#ifdef usestubs
  set_debug_traps ();
  set_debug_traps ();
  breakpoint ();
  breakpoint ();
#endif
#endif
 
 
#ifdef SIG_SETMASK
#ifdef SIG_SETMASK
  /* Ensure all the signals aren't blocked.
  /* Ensure all the signals aren't blocked.
     The environment in which the testsuite is run may have blocked some
     The environment in which the testsuite is run may have blocked some
     for whatever reason.  */
     for whatever reason.  */
  {
  {
    sigset_t newset;
    sigset_t newset;
    sigemptyset (&newset);
    sigemptyset (&newset);
    sigprocmask (SIG_SETMASK, &newset, NULL);
    sigprocmask (SIG_SETMASK, &newset, NULL);
  }
  }
#endif
#endif
 
 
  signal (SIGABRT, handle_signal);
  signal (SIGABRT, handle_signal);
 
 
  /* Stop here so we can hand-call gen_signal.  */
  /* Stop here so we can hand-call gen_signal.  */
  stop_one ();
  stop_one ();
 
 
  /* When we're resumed stop here.  */
  /* When we're resumed stop here.  */
  stop_two ();
  stop_two ();
 
 
  /* When we're resumed we generate a signal ourselves.  */
  /* When we're resumed we generate a signal ourselves.  */
  gen_signal ();
  gen_signal ();
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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