cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/29/12:35:18

Sender: root AT delorie DOT com
Message-ID: <386A109F.34C6272F@inti.gov.ar>
Date: Wed, 29 Dec 1999 10:46:08 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.38 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: GDB, DOS 6.22, CWSDPMI and Interrupts
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991229144716 DOT 13248A-100000 AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> On Wed, 29 Dec 1999, salvador wrote:
>
> > > I have successfully run under GDB 4.18 programs that use setitimer, so
> > > interrupts are not disabled in general under a debugger.
> >
> > Did your program call any real mode stuff between interrupts?
>
> Nothing except printf, I think.  It was a simple test program.
>
> I'm not sure I understand how does real-mode code enter the equation
> here.  Are you telling that even a single mode switch is enough to
> re-enable interrupts for the rest of the program?

Nope, interrupts remains disabled.

> Or are you telling
> that the interrupts are deferred until the CPU switches to RM?

Most probably that's the effect.

> If the latter, then the timer tick will stop updating the system clock as
> long as the program doesn't cause a mode switch, right?  If you write a
> test program that stays in PM for prolonged period of time, you should
> see a huge time error in the system clock when the program exits.  Is that
> what happens under the debugger?

The following program:

#include <stdio.h>
#include <dos.h>
#include <time.h>

int main(int argc, char *argv[])
{
 int rv;
 time_t tiempo;
   __asm__ __volatile__("pushf; popl %0" : "=g" (rv));
 rv = (rv>>9) & 1;
 printf("%d\n",rv);

 //enable();

 unsigned long cont;
 tiempo=time(0);
 for (cont=0;cont<0xfffffffe;cont++);
 tiempo=time(0)-tiempo;
 printf("Tiempo: %d\n",tiempo);

 return 0;
}

Gives 24 outside the debugger and 0 inside the debugger.

Note: If I uncomment the enable() line the program works, but the real program doesn't
(interrupts gets disabled automagically).

> > >  Also, SIGINT
> > > uses the keyboard interrupt, so if your program gets SIGINT when run
> > > under a debugger, interrupts are not disabled.
> >
> > No, I'm not getting SIGINT.
>
> So what *does* happen when you press Ctrl-C while the program runs under
> a debugger?

Just nothing, the machine seems to hang and I must reset the computer. In fact my first
impression was that the progra,really hanged, until I put code to show activity. I tried
it under DOS 7 and I get the same results.

SET

--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
                    set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



- Raw text -


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