This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Defaulting to stabs debug output from AS Cygwin64
- From: Hans-Bernhard Bröker <HBBroeker at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Tue, 15 May 2018 22:41:27 +0200
- Subject: Re: Defaulting to stabs debug output from AS Cygwin64
- References: <CAOC2fq-rSqiikBs2r3K-s=G6VWfGu_bE19KFEdn8jymwkTreBQ@mail.gmail.com> <551ec1bb-60e2-2372-8e1a-f4cb839ae454@gmail.com> <CAOC2fq-fhFXBPBVFWNQpqUeKZf-2KFowUeAzv9xkBSDQud=1zg@mail.gmail.com>
Am 15.05.2018 um 19:17 schrieb Michael Enright:
The GCC driver uses -gdwarf2 if you do 'gcc -g' on a .s file. Using
-gdwarf2 with assembly code manually or through gcc is successful in
producing a Cygwin64 executable that Cygwin64 GDB can work with. This
combination of circumstances led me to wonder how stabs was chosen for
Cygwin64.
Basically because it was not chosen. It's not even actually supported,
as evidenced by those relocation failures: not how those occurred in the
.stab section.
"The" default of Cygwin is whatever the compiler uses, i.e. Dwarf2, and
was indeed chosen, because none of the older formats stand a chance of
really handling the amount and complexity of debug information needed
for modern-day C++.
On to of that, making '-gdwarf-2' the default -g mode for 'as' would be
an exercise in futility anyway, because that option is essentially a
no-op. That's because Dwarf-2 debug information is _not_ actually
created by the -g flag to begin with: it's spelled out by the compiler
as reams of data and reloc statements, to go into specially named
sections like '.debug_info'. GCC doesn't even pass any '-g' flag to the
assembler in its default -gdwarf-2 mode.
It makes sense that "as -g" equals "as -gstabs" because unlike the other
ones, that one at least does something: it causes .def pseudo-ops to put
data into the .stab section, which also is automatically created by that
option.
In a nutshell: you don't want to use either of "as -g" or "as -gstabs"
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple