Mail Archives: djgpp-workers/1999/02/26/03:54:13
Hi!
Recently I noticed one rather annoying thing with debugging DJGPP
programs:
- when program I'm debugging spawns another program and spawned
program returns non zero return code then I still getting 0 as
return value from spawn* () functions.
The source of problem is bug in hooking DPMI interrupt (int 0x31) in
src/debug/common/dbgcom.c:
- some of DPMI calls hooked in dbgcom.c which don't use register
%dx still errorously corrupts it (Fn. 0x0101, 0x0502, etc).
It is necessary to preserve all registers whech should not be
chenged when hooking software interrupt. __exit uses %dl
to temporary store program return code but it is corrupted
due to bug in dbgcom.c
I'm not sending patch here as I'm using havily modified version of
dbgcom.c with following additional features:
- at least limited support of hooking exceptions, so I can
interrupt program with SIGINT in debugger and resume execution
(changes mostly by Pierre Muller, also I participated)
- saving FP status moved to dbgcom.c (patches from Robert, but as
I have tested they not in CVS version, even if they have sent to
this mailing list)
- fixed problem I mentioned above with getting return code from
spawned program.
Unfortunatelly modified dbgcom.c also contains copletely editional changes
(eg. changed names of assembler labels and source format in some places)
My tests:
- I'm using it in patched version of rhide-1.4.7 and it works Ok.
No related problems detected. Latest rhide binaries from my
homepage (see http://ww.lanet.lv/~pavenis/rhide.html) contains
all dbgcom.c changes except the last one.
- gdb-4.17, fsdb works Ok (I only getting some problems with
debug info with FSDB as I'm using development snapshots of
binutils)
Andris
- Raw text -