delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/12/05/14:14:57

Date: Thu, 5 Dec 1996 19:59:14 +0100 (MET)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Bad return value when debugging
Message-Id: <Pine.HPP.3.95.961205194800.2153C-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

Because of a hint of a user I tried it also and found, that somewher
the return value of a program is not returned correct when running
this program under any debugger (DJGPP of course). Or betther: is
always zero. I have tried
it with gdb, fsdb, rhgdb and RHIDE and so I think, there is somewhere
a bug either in 'dbgcom.c' or in 'exceptn.s'.

Here is the program, which I have tested:
------------------------------------
int main(void)
{
  return -1;
}
------------------------------------

Ok. I have looked in the two files and think the problem is when the
debuggee exits, this is hooked in dbgcom.c. Then there is a call to
(Oh please forgive me, I have not the exact functions here)
__djgpp_save_exception_registers(). Until this point I can follow,
but after a look in the assembler file (exceptn.s) I gave up,
becuase I couldn't understand it in all details, but I think, at
the end of the function are the selectors compared and in case
of the result, the __djgpp_exception_ptr is changed or not.

Please can check this someone, who understand more than I about
this?? (Charles?).

Robert

- Raw text -


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