diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-05 18:21:00 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-05 18:22:20 -0800 |
commit | ead25cf512fcd70177fcc8d27918e8147d02d045 (patch) | |
tree | e41c265745c18cb3361a83558c264cf7dc3f2aef /elaborate.cxx | |
parent | 8d9cf9b0e5eb0f751dc432cdfe055e301cc065c8 (diff) | |
download | systemtap-steved-ead25cf512fcd70177fcc8d27918e8147d02d045.tar.gz systemtap-steved-ead25cf512fcd70177fcc8d27918e8147d02d045.tar.xz systemtap-steved-ead25cf512fcd70177fcc8d27918e8147d02d045.zip |
Make sure synthesized var display is tokenful
* elaborate.cxx (add_global_var_display): Assign a few token*s.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index 72f12baf..59110c75 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1290,6 +1290,7 @@ void add_global_var_display (systemtap_session& s) vector<derived_probe*> dps; block *b = new block; + b->tok = l->tok; probe* p = new probe; p->tok = l->tok; @@ -1302,7 +1303,7 @@ void add_global_var_display (systemtap_session& s) g_sym->type = l->type; g_sym->referent = l; - token* print_tok = new token; + token* print_tok = new token(*l->tok); print_tok->type = tok_identifier; print_tok->content = "printf"; @@ -1382,6 +1383,7 @@ void add_global_var_display (systemtap_session& s) fe->sort_direction = -1; // imply decreasing sort on value fe->sort_column = 0; // as in foreach ([a,b,c] in array-) { } fe->limit = NULL; + fe->tok = l->tok; // Create indices for the foreach loop for (int i=0; i < idx_count; i++) @@ -1401,17 +1403,17 @@ void add_global_var_display (systemtap_session& s) } // Create a printf for the foreach loop - pf->raw_components += "["; + pf->raw_components += "["; for (int i=0; i < idx_count; i++) - { - if (i > 0) - pf->raw_components += ","; - if (l->index_types[i] == pe_string) - pf->raw_components += "\"%#s\""; - else - pf->raw_components += "%#d"; - } - pf->raw_components += "]"; + { + if (i > 0) + pf->raw_components += ","; + if (l->index_types[i] == pe_string) + pf->raw_components += "\"%#s\""; + else + pf->raw_components += "%#d"; + } + pf->raw_components += "]"; if (l->type == pe_stats) pf->raw_components += " @count=%#x @min=%#x @max=%#x @sum=%#x @avg=%#x\\n"; else if (l->type == pe_string) @@ -1453,6 +1455,7 @@ void add_global_var_display (systemtap_session& s) pf->components = print_format::string_to_components(pf->raw_components); expr_statement* feb = new expr_statement; feb->value = pf; + feb->tok = l->tok; fe->base = g_sym; fe->block = (statement*)feb; b->statements.push_back(fe); |