delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/03/31/14:02:26

Sender: RUPP AT gnat DOT com
Message-ID: <333F937D.4E7F0716@gnat.com>
Date: Mon, 31 Mar 1997 10:35:41 -0800
From: Douglas Rupp <rupp AT gnat DOT com>
Organization: Ada Core Technologies
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: GDB and SIGALRM

This is a multi-part message in MIME format.

--------------3142E89718253A8465C6526D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

What would be involved in getting a program that raises SIGALRM to work
with GDB?

See attacted test program that causes SEGV in GDB.

--------------3142E89718253A8465C6526D
Content-Type: text/plain; charset=us-ascii; name="TEST3.C.2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="TEST3.C.2"

#include <sys/time.h>
#include <signal.h>
#include <conio.h>
static void
handler (signo)
{
  printf ("handler\n");
}

main ()
{

  struct itimerval value, ovalue;
  int i;

  value.it_interval.tv_sec = 0;
  value.it_interval.tv_usec = 0;
  value.it_value.tv_sec = 3;
  value.it_value.tv_usec = 0;

  signal (SIGALRM, handler);
  setitimer (ITIMER_REAL, &value, NULL);
  for (i=0; i<10; i++)
    sleep(1);
}

--------------3142E89718253A8465C6526D--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019