Date: Wed, 11 Dec 1996 11:26:02 +0100 (MET) From: Robert Hoehne To: Eli Zaretskii Cc: DJGPP workers Subject: Re: Bad return value when debugging In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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