Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Nov 1997 00:51:34 -0800 (PST)
From:      "David L. Kashtan" <KASHTAN@YOYODYNE.COM>
To:        hackers@FreeBSD.ORG
Subject:   GDB has trouble debugging programs that use signals under FreeBSD 2.2.2
Message-ID:  <878806294.629408.KASHTAN@YOYODYNE.COM>

next in thread | raw e-mail | index | archive | help
I have a fairly simple program that is not totally debuggable under gdb
and FreeBSD 2.2.2 -- the initial problem seems to be that the constant
SIGTRAMP_START needs to be 0xefbfdfc0 rather than 0xfdbfdfc0 and
SIGTRAMP_END needs to be 0xefbfe000 rather than 0xfdbfe000

This, at least made things better.

The remaining problem is that when an SIGALRM signal fires gdb is not
capable of correctly executing a "next" command -- it gives the signal to
the child and stops right back where it started, announcing that the child
got a BPT/TRAP.

Before I spend I whole lot of time debugging this, I was wondering if anybody
else had seen/dealt-with this problem.  Surely, people have tried to debug programs
that use timer signals?

Here is a simple program to exercise the problem:

#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
 
int XXX = 0;
 
static void Alarm_Handler(int Sig)
{
        XXX++;
        printf("SIGALRM #%d\n", XXX);
}
 
void setup(void)
{
        struct itimerval it;
 
        signal(SIGALRM, Alarm_Handler);
        it.it_interval.tv_sec = 1; it.it_interval.tv_usec = 10000;
        it.it_value.tv_sec = 1; it.it_value.tv_usec = 10000;
        if (setitimer(0, &it, 0) < 0) printf("setitimer");
}
 
static void foo(void){}
int main(int argc, char *argv[])
{
        static int YYY = 0;
        setup();
        while(1) {
                foo();
                YYY++;
        }
}





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?878806294.629408.KASHTAN>