X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Thu, 7 Feb 2002 13:12:50 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Steuer cc: djgpp AT delorie DOT com Subject: Re: Strange gdb behaviour In-Reply-To: <5.0.2.1.2.20020207111510.009e0400@pop.gmx.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 7 Feb 2002, Martin Steuer wrote: > 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. It's a known problem, due to the way CWSDPMI implements the Int 31h interface. For details, read the discussion on djgpp-workers list whose subject is "GDB, DOS 6.22, CWSDPMI and Interrupts". The message which started that discussion is here: http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-workers/1999/12/30/02:54:16 The only known work-around is to inject ``asm("sti")'' into your program from time to time.