Mail Archives: djgpp-workers/1996/12/11/05:33:08
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 -