X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Message-ID: <55623666.7060908@iki.fi> Date: Sun, 24 May 2015 23:36:54 +0300 From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi)" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: New GDB versions and DJGPP (Was: ANNOUNCE: DJGPP 2.05 beta 1) References: <201505042003 DOT t44K3odg011007 AT delorie DOT com> <555829A6 DOT 8010502 AT iki DOT fi> <555870E8 DOT 7040302 AT iki DOT fi> <201505180114 DOT t4I1EiaX017288 AT envy DOT delorie DOT com> <201505181216 DOT t4ICGaKO014123 AT envy DOT delorie DOT com> <83zj52dkns DOT fsf AT gnu DOT org> <555A0DD5 DOT 1010607 AT iki DOT fi> <83r3qdemuj DOT fsf AT gnu DOT org> <555AADE6 DOT 3030905 AT iki DOT f> <83lhgkehn4 DOT fsf AT gnu DOT org> <201505191714 DOT t4JHEr0B010992 AT envy DOT delorie DOT com> <83vbfo7a74 DOT fsf AT gnu DOT org> <201505191729 DOT t4JHTIRe011541 AT envy DOT delorie DOT com> <83sias77km DOT fsf AT gnu DOT org> <555CFF9C DOT 1050301 AT gmx DOT de> <555D5E30 DOT 7020107 AT iki DOT fi> <83vbfl6hs9 DOT fsf AT gnu DOT org> <55618917.7@[87.69.4.28]> <83d21q1g6n DOT fsf AT gnu DOT org> In-Reply-To: <83d21q1g6n.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com On 05/24/2015 12:24 PM, Eli Zaretskii (eliz AT gnu DOT org) wrote: >> Date: Sun, 24 May 2015 11:17:27 +0300 >> From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi)" >> >>> So what and how goes wrong in the DJGPP build of GDB? Can someone >>> with enough free time step through the go32 initialization, and see >>> what's wrong there? >> Perhaps at least some hint could give GDB commit which caused that DJGPP port stopped to work (with >> symptoms described earlier) >> >> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=9b409511d07fe375284701af34909fb539029caf > Thanks! > > Actually, it seems bd265cd0bde9e045ab5946532449430b66fe91ad, which is > a followup to the one you mentioned, is the bad commit. It seems a > simple case of misunderstanding the API conventions of our read_child > and write_child. > > Can you try the patch below? If it fixes the problem, I will push it. > > diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c > index f3966cd..852473b 100644 > --- a/gdb/go32-nat.c > +++ b/gdb/go32-nat.c > @@ -587,6 +587,13 @@ > else > res = read_child (memaddr, readbuf, len); > > + /* read_child and write_child return zero on success, non-zero on > + failure; adjust the result value to that. */ > + if (res == 0) > + res = len; > + else > + res = -1; > + > if (res <= 0) > return TARGET_XFER_E_IO; > > > I can confirm that with this patch applied I git current GIT master version of GDB to work for DJGPP: - same example program cc1.exe from my earlier gcc-4.8.4 build used - no error messages about accessing process memory - backtrace somewhat unreliable but mostly works Some small build problems: - perhaps it would be best to kill dos_noop() in gdb-ser32.c and add appropriate static functions instead (proptype of of one of them has changed in master branch, which caused compile error) - got also DJGPP related compile error which is potentially related to latest changes, but I did not have time to check whether it so Also: Tried also cc1.exe from my last gcc-5.1.0 build with about the same results as with gcc-4.8.4 except that backtrace works sligthly worse. Also: fails to read debug info from cc1.exe from gcc-6.0.0 20150506 snapshot build and complains about dwarf error (could not find abbrev number 115 ....) cc1.exe used from each tests were from stage 3 compile which is built by stage2 compiler of the same version. Andris