X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs Date: Fri, 26 Feb 1999 10:47:38 +0200 (WET) From: Andris Pavenis To: djgpp-workers AT delorie DOT com Subject: Some problems with dbgcom.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com 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