public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/32998] -frecord-gcc-switches issues
Date: Tue, 12 Jul 2011 16:26:00 -0000	[thread overview]
Message-ID: <bug-32998-4-r7itnYp4Tu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-32998-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32998

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-12 16:26:10 UTC ---
Created attachment 24746
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24746
gcc47-pr32998.patch

Untested patch to implement a new switch, -grecord-gcc-switches, which records
passed options as a string appended to DW_AT_producer attribute in .debug_info.
Apparently we aren't the first compiler to do that based on the dwarf2out.c
comments...
The main intent is to have the code generation options in there, as Roland
said, -D* etc. options should be investigable through -g3 .debug_macinfo
(especially if we manage to cut it down considerably), similarly -I/-i* etc.
options related to preprocessing are either in .debug_macinfo and/or in
.debug_line).  If possible I'd like not to see filenames and paths in the
string.

I'm not entirely happy with it this way, as if passed command line options
override each other, this approach will print all of them in the order
specified
(say -O2 -O3 -O0 inserts -O2 -O3 -O0 instead of just -O0) and due to the
overriding the options can't be sorted, which would increase the likelyhood
that the DW_AT_producer strings are mergeable between many object files.

Joseph, is there a way to instead iterate over the explicitly passed options
after override processing?  I see global_options_set, but not sure what exactly
to expect from it.


  parent reply	other threads:[~2011-07-12 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-32998-4@http.gcc.gnu.org/bugzilla/>
2010-10-02 16:06 ` jan.kratochvil at redhat dot com
2010-10-05  0:42 ` roland at redhat dot com
2010-10-05  9:48 ` jakub at gcc dot gnu.org
2010-10-05 19:54 ` roland at redhat dot com
2011-04-22 18:49 ` jan.kratochvil at redhat dot com
2011-07-12 16:26 ` jakub at gcc dot gnu.org [this message]
2011-07-22 20:04 ` jakub at gcc dot gnu.org
2012-06-14  9:22 ` philomath868 at gmail dot com
2007-08-05 21:17 [Bug other/32998] New: " jakub at gcc dot gnu dot org
2007-08-06  8:12 ` [Bug other/32998] " nickc at redhat dot com
2007-08-06 16:17 ` bkoz at gcc dot gnu dot org
2007-08-06 19:19 ` roland at redhat dot com
2007-08-07  8:11 ` nickc at redhat dot com
2007-08-07  8:25 ` nickc at redhat dot com
2010-06-20 21:03 ` jsm28 at gcc dot gnu dot org
2010-06-20 21:05 ` jsm28 at gcc dot gnu dot org
2010-06-20 21:20 ` manu at gcc dot gnu dot org

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=bug-32998-4-r7itnYp4Tu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).