delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2015/05/25/10:37:53

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Mon, 25 May 2015 17:37:31 +0300
From: "Eli Zaretskii (eliz AT gnu DOT org)" <djgpp AT delorie DOT com>
Subject: Re: New GDB versions and DJGPP
In-reply-to: <55631918.2060108@gmx.de>
X-012-Sender: halo1 AT inter DOT net DOT il
To: djgpp AT delorie DOT com
Message-id: <83r3q4zpsk.fsf@gnu.org>
References: <201505042003 DOT t44K3odg011007 AT delorie DOT com> <CAA2C=vA73qPvoDFytp3FeW6bCD1-XuGsFFoDinoKn2KYY1fkow AT mail DOT gmail DOT com> <555870E8 DOT 7040302 AT iki DOT fi> <CAA2C=vDhD6BJj89o1i0FRd2U0H4bTpGGN4zH6qs7FJKxzqhuQg AT mail DOT gmail DOT com> <201505180114 DOT t4I1EiaX017288 AT envy DOT delorie DOT com> <CAA2C=vCyrQ_+Yq6XsRD-UO4r=j9WoGGiXoqQFrkbiEQpzX+=MA AT mail DOT gmail DOT com> <201505181216 DOT t4ICGaKO014123 AT envy DOT delorie DOT com> <CAA2C=vCk5MY74z+HNVzzdLByg71Y_9ObK-1jPxJ_KF8eqRDZMQ AT mail DOT gmail DOT com> <83zj52dkns DOT fsf AT gnu DOT org> <CAA2C=vAPcN+MKC_2tcZqVmo9gvF2Cxdo+K+-qfKaNrQuCkMnEw AT mail DOT gmail DOT com> <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> <5561C8A0 DOT 2010401 AT gmx DOT de> <5561F262 DOT 2010001 AT gmx DOT de> <83wpzyyn0u DOT fsf AT gnu DOT org> <55631918 DOT 2060108 AT gmx DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Mon, 25 May 2015 14:44:08 +0200
> From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de)" <djgpp AT delorie DOT com>
> 
> To make the long story short:  the error was to use the -ggdb flag.  The djgpp
> port of gcc seems not to understand this.

Thanks for looking into this.  This should be reported to the GCC
maintainers (or maybe Andris will be able to fix that regardless).

> The right flag is -gdwarf-2.  It is
> also possible to compile with -gdwarf-3 and -gdwarf-4 but later the info source
> command always claims that the debug format is DWARF2.  It seems to be of no
> benefit to use either the -gdwarf-3 or -gdwarf4 flag.

That's a common misconception: -gdwarf-N actually generates debug info
according to DWARF Standard version N.  GDB says it's all DWARF2 for
historical reasons.

You should be able to see the difference between the various values of
N by running "objdump --dwarf" on the executable and comparing the
output.  (If the output is identical, then there's another bug in the
DJGPP port of GCC; GCC 4.8.1 provided by MinGW does support N=3 and
N=4, and the results are definitely different.)

> Using -gcoff makes no sense at all for debugging because it makes
> gdb crash like this:
> 
> C:\tmp\5>gdb a.exe
> GNU gdb (GDB) 7.9.1
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i786-pc-msdosdjgpp --target=djgpp".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from a.exe...rmvfromfree: memory fouled
> Exiting due to signal SIGABRT
> Raised at eip=003f96da
> eax=005440e4 ebx=00000120 ecx=00000011 edx=00000000 esi=00000198 edi=00000198
> ebp=000001a8 esp=005440d0 program=C:\DJGPP-2.04\BIN\GDB.EXE
> cs: sel=01a7  base=02990000  limit=006affff
> ds: sel=01af  base=02990000  limit=006affff
> es: sel=01af  base=02990000  limit=006affff
> fs: sel=017f  base=00008e80  limit=0000ffff
> gs: sel=01bf  base=00000000  limit=0010ffff
> ss: sel=01af  base=02990000  limit=006affff
> App stack: [00544788..004c478c]  Exceptn stack: [004c46e8..004c27a8]
> 
> Call frame traceback EIPs:
>    0x003f96da
> 
> C:\tmp\5>
> 
> I do not think it make sense to investigate this issue any more.

Too bad: it means the new GCC/GDB are of no use for debugging Emacs.
Sounds like some memory allocation error to me.

> Using -gdwarf-2 makes work gdb again at least for the test cases I have tried.
> The bt command works and also the step and next commands work as they should.
> I do not understand why -ggdb did not work.  I expected the port of the compiler
> to be clever enough to know that -ggdb means -gdwarf-2 for a DJGPP port of gcc.
> But it seems to be that I am wrong.

You are right; it's a bug in GCC.

Thanks.

- Raw text -


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