2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-12 12:02:24 +00:00

Improved debugging output:

* added space after "on"
   * try harder to indicate in which module a rule is going to execute
   * Stop printing the module context of variable settings; it was
     confusing especially when the variable turned out to be a local
     variable or an argument name.
   *

Register the name by which each rule is /invoked/ in its frame instead
of the name by which the rule was defined. This changes the behavior
of the builtin BACKTRACE rule, causing it to register the rule's
invocation names (filenames and line numbers lead the user to the
definition context anyway). This change was neccessary in order to
support classes: we can now extract the name of a class being
initialized by looking at the backtrace from within the class module's
__init__ rule.


[SVN r13585]
This commit is contained in:
Dave Abrahams
2002-04-30 14:22:46 +00:00
parent 2e6f58d76f
commit 38b1628e8d

View File

@@ -30,6 +30,7 @@
# include <time.h>
# include <assert.h>
# include <string.h>
/*
* compile.c - compile parsed jam statements
@@ -775,15 +776,29 @@ evaluate_rule(
return result;
}
if ( DEBUG_COMPILE )
{
debug_compile( 1, l->string, frame);
lol_print( frame->args );
printf( "\n" );
}
rulename = l->string;
rule = bindrule( l->string, frame->module );
if ( DEBUG_COMPILE )
{
/* Try hard to indicate in which module the rule is going to execute */
if ( rule->module != frame->module
&& rule->procedure != 0 && strcmp(rulename, rule->procedure->rulename) )
{
char buf[256] = "";
strncat( buf, rule->module->name, sizeof(buf) - 1 );
strncat( buf, rule->name, sizeof(buf) - 1 );
debug_compile( 1, buf, frame);
}
else
{
debug_compile( 1, rulename, frame);
}
lol_print( frame->args );
printf( "\n" );
}
if ( rule->procedure && rule->module != prev_module )
{
/* propagate current module to nested rule invocations */
@@ -803,7 +818,7 @@ evaluate_rule(
/* record current rule name in frame */
if ( rule->procedure )
{
frame->rulename = rule->procedure->rulename;
frame->rulename = rulename;
/* and enter record profile info */
if ( DEBUG_PROFILE )
profile_enter( rule->procedure->rulename, prof );
@@ -923,7 +938,6 @@ compile_set(
if( DEBUG_COMPILE )
{
debug_compile( 0, "set", frame);
printf( frame->module->name );
list_print( nt );
printf( " %s ", trace );
list_print( ns );
@@ -1017,7 +1031,7 @@ compile_settings(
{
debug_compile( 0, "set", frame);
list_print( nt );
printf( "on " );
printf( " on " );
list_print( targets );
printf( " %s ", append ? "+=" : "=" );
list_print( ns );