www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/07/06:15:23

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 <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Steuer <martinSteuer AT gmx DOT de>
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: <Pine.SUN.3.91.1020207130618.15593A-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


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