#855: config/init/defaults.pm: Profiling options are too specific to GCC
-----------------------+----------------------------------------------------
Reporter: jkeenan | Owner: jkeenan
Type: bug | Status: assigned
Priority: minor | Milestone:
Component: configure | Version: 1.3.0
Severity: medium | Keywords: profile gcc debug
Lang: | Patch:
Platform: all |
-----------------------+----------------------------------------------------
Comment(by jkeenan):
The more I look at this ticket, the more of a morass it seems.
Assignments to the various `*_debug` attributes are strewn over several
configuration steps.
{{{
find config -type f | xargs grep -n debug | grep -vE '(debug\(|/gen)'
config/init/defaults.pm:90: debugging =>
$conf->options->get('debugging') ? 1 : 0,
config/init/defaults.pm:140: cc_debug => '-g',
config/init/defaults.pm:141: link_debug => '',
config/init/defaults.pm:161: # include debug info in executable
config/init/defaults.pm:162: ld_debug => '',
config/init/defaults.pm:245: # debugging internals.
config/init/defaults.pm:256:# cc_debug => " -pg ",
config/init/defaults.pm:257:# ld_debug => " -pg ",
config/init/hints/mswin32.pm:91: cc_debug => '-Zi',
config/init/hints/mswin32.pm:92: ld_debug =>
'-debug',
config/init/hints/mswin32.pm:125: # We can't use -opt: and -debug
together.
config/init/hints/mswin32.pm:126: if ( $conf->data->get('ld_debug')
=~ /-debug/ ) {
config/init/hints/mswin32.pm:143: cc_debug => '-Zi',
config/init/hints/mswin32.pm:146: ld_debug =>
'-debug',
config/init/hints/mswin32.pm:164: # We can't use -opt: and -debug
together.
config/init/hints/mswin32.pm:165: if ( $conf->data->get('ld_debug')
=~ /-debug/ ) {
config/init/hints/mswin32.pm:182: cc_debug => '-v',
config/init/hints/mswin32.pm:188: ld_debug => '-v',
config/inter/progs.pm:10:lexical analyzer generator and parser generator
to use. Also whether debugging
config/inter/progs.pm:42: return unless defined $debug;
config/inter/progs.pm:144:sub _get_debug {
config/inter/progs.pm:146: my $debug = 'n';
config/inter/progs.pm:147: $debug = 'y' if
$conf->options->get('debugging');
config/inter/progs.pm:148: $debug = prompt( "Do you want a debugging
build of Parrot?", $debug )
config/inter/progs.pm:150: ( $debug =~ /^[yn]$/i ) ? return $debug :
return;
config/inter/progs.pm:153:sub _set_debug {
config/inter/progs.pm:154: my ($conf, $debug) = @_;
config/inter/progs.pm:155: if ( $debug =~ /n/i ) {
config/inter/progs.pm:157: cc_debug => '',
config/inter/progs.pm:158: link_debug => '',
config/inter/progs.pm:159: ld_debug => ''
config/init/optimize.pm:68: # disable debug flags.
config/init/optimize.pm:69: $conf->data->set( cc_debug => '' );
}}}
Let's translate this into humanspeak. `init::defaults` sets a key
`debugging` if the command-line option `debugging` has been set. Then,
regardless of the setting of `debugging`, it sets `-g` as the default
value for `cc_debug`, an empty string as the default value for
`link_debug` and `ld_debug`. Then, if command-line option `profile` has
been set, `-pg` is set as the value for `cc_debug` and `ld_debug` -- but
not `link_debug`! (I'm looking at code in the ''tt855_debugging_options''
branch here.)
Next, if and only if you're on Win32, ''init::hints::mswin32'' sets values
for `cc_debug` and `ld_debug` depending -- to oversimplify -- on which C
compiler you're using. It also makes use of `-opt` and `-debug` mutually
exclusive.
Next, `inter::progs` allows interactive setting of debugging options. Or,
to be more precise, it permits the user to interactively request
debugging. If at this point the user explicitly defines a debugging
build, all previous settings to the three attributes are wiped out.
Finally, in `init::optimize`, ''Configure.pl'' asks whether the user has
requested an optimized build. If so, then `cc_debug` is set to an empty
string, regardless of any earlier settings -- but `link_debug` and
`ld_debug` are untouched.
Confused? You're not alone.
One thing that has become apparent to me is that we have to distinguish
between the user's '''request for a debugging build''' and the
'''assignment of correct values to the 3 debugging attributes'''.
Another thing that has become apparent to me is that we have '''one'''
determination of which operating system we're on in or prior to
`init::hints`, but we do not set definitive values for `osname` until a
later configuration step, `auto::arch`.
That's where my understanding of the issues currently stands. Thank you
very much.
kid51
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/855#comment:11>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets