public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Hans-Bernhard Bröker" <HBBroeker@t-online.de>
To: cygwin@cygwin.com
Subject: Re: Defaulting to stabs debug output from AS Cygwin64
Date: Tue, 15 May 2018 21:18:00 -0000	[thread overview]
Message-ID: <068140eb-e8bf-c5a9-41e5-36120983cc9b@t-online.de> (raw)
In-Reply-To: <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

      reply	other threads:[~2018-05-15 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 12:49 Michael Enright
2018-05-15 13:18 ` cyg Simple
2018-05-15 17:41   ` Michael Enright
2018-05-15 21:18     ` Hans-Bernhard Bröker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=068140eb-e8bf-c5a9-41e5-36120983cc9b@t-online.de \
    --to=hbbroeker@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).