Article View: gnu.gdb.bug
Article #10182gdb bug with signals?
From: Paul English x3168
Date: Mon, 23 Apr 1990 16:00
Date: Mon, 23 Apr 1990 16:00
57 lines
1527 bytes
1527 bytes
This is a small program to demonstrate how a continue in gdb does not
do anything most of the time. It is in fact very hard to step through the
loop.
The commands for gdb are:
b 15
display count
r
(count == 0)
p timer_count (equal to 1)
c
(count == 0)
p timer_count (equal to 2)
c
(count == 0)
p timer_count (equal to 3)
If next or step are use instead of continue the count will slowly increase.
#include "signal.h"
#include "sys/time.h"
static int timer_count = 0;
static int count;
main()
{
int i;
start_timer();
for (i = 0; i < 1000; i++)
count = i;
}
start_timer()
{
struct itimerval timer ;
timer_count++;
timer.it_interval.tv_sec = 0;
timer.it_interval.tv_usec = 0 ;
timer.it_value.tv_sec = 0;
timer.it_value.tv_usec = 200;
signal(SIGALRM, start_timer) ;
setitimer(ITIMER_REAL, &timer, 0) ;
}
Technical Details
Message-ID:
<9004231600.AA01578@speed.io.uucp>Path:
arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!EDDIE.MIT.EDU!ileaf!io!speed!pmeShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,7285b46b1f36640c,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1990-04-23 15:33:19 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!EDDIE.MIT.EDU!ileaf!io!speed!pme From: ileaf!io!speed!pme@EDDIE.MIT.EDU (Paul English x3168) Newsgroups: gnu.gdb.bug Subject: gdb bug with signals? Message-ID: <9004231600.AA01578@speed.io.uucp> Date: 23 Apr 90 16:00:59 GMT Sender: lohse@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 57 Posted: Mon Apr 23 17:00:59 1990