delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/12/11/05:33:08

Date: Wed, 11 Dec 1996 11:26:02 +0100 (MET)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: Bad return value when debugging
In-Reply-To: <Pine.SUN.3.91.961208193905.3884B-100000@is>
Message-Id: <Pine.HPP.3.95.961211111742.17956E-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

I did now some checks and came to a very interesting result:

The bug with bad return value is probably NOT in the functions
related to any of the debuggers, but somewhere else (in libc??
in the DPMI server??).

You can see this, if you debug the following the following
program once with "-DASM_EXIT" and once without that define.
---------------------------------------------------------------
int main()
{
#ifdef ASM_EXIT
  /* If running in a debugger, this produces the expected return value 1 */
  asm("movw $0x4c01,%ax\n int $0x21");
  return 1; /* makes gcc happy */
#else
  /* If running in a debugger, this produces a return value 0 !!!! */
  exit(1);
  return 1; /* makes gcc happy */
#endif
}

---------------------------------------------------------------

As you can see, if I call int 0x21 direct, the return value is
correct, but NOT when calling exit(). Just mysterious for me.

I have also debugged a little bit 'dbgcom.c' and there the
'_i21_hook'. If this hook is called normaly by the exit functions
the register ax contains always 0x4c00. Again mysterious for me.

Robert

- Raw text -


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