Mail Archives: djgpp/2002/02/07/05:40:17
Hello everybody!
When I was debugging a program with a loop I set a breakpoint in it and
found that the interrupts where erroneously disabled (the loop could only
be left by pressing a specific key). I could verify that only the
interrupts where disabled, the main program execution was going on.
At first I thought it would be a problem in my program, but at the end I
could reduce it to a really simple loop, here it is:
#include <pc.h>
#include <conio.h>
int main()
{
char key = 0;
while (key != 27)
{
// __asm__ __volatile__ ("sti");
if (kbhit()) key = getch();
}
return 0;
}
The interrupts get disabled whenever I set a breakpoint somewhere, it can
be on EVERY line. If I uncomment the sti instruction it works.
The problem only occurs under pure dos, so I can imagine that it might be
the result of a problem in cwsdpmi too.
I'm using gcc v 2.952, gdb v 5.0 and cwsdpmi reports v0.9+ (r5).
Any help would be nice, also if one could check this under different
versions it would be good.
Thanks alot!
- Raw text -