diff options
author | Stan Cox <scox@redhat.com> | 2008-08-29 13:07:45 -0400 |
---|---|---|
committer | Stan Cox <scox@redhat.com> | 2008-08-29 13:07:45 -0400 |
commit | 6d2685fe52d82e07fb4c0d73ac9ed90d4b7735d5 (patch) | |
tree | 74815d8c7f098a54fcdd797f86ae5b7783643970 /elaborate.cxx | |
parent | 4576d5d3faa3889fda8d6cef2664aa8dfddd61af (diff) | |
download | systemtap-steved-6d2685fe52d82e07fb4c0d73ac9ed90d4b7735d5.tar.gz systemtap-steved-6d2685fe52d82e07fb4c0d73ac9ed90d4b7735d5.tar.xz systemtap-steved-6d2685fe52d82e07fb4c0d73ac9ed90d4b7735d5.zip |
Repopulate symbol/type info.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index 88133c31..7ecba049 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1170,6 +1170,7 @@ void add_global_var_display (systemtap_session& s) probe_point::component* c = new probe_point::component("end"); token* print_tok = new token; vector<derived_probe*> dps; + block *b = new block; pl->components.push_back (c); token* p_tok = new token; @@ -1206,17 +1207,7 @@ void add_global_var_display (systemtap_session& s) expr_statement* feb = new expr_statement; feb->value = pf; feb->tok = print_tok; - block *b = new block; b->statements.push_back(feb); - p->body = b; - - derive_probes (s, p, dps); - - // Repopulate the type info. Should semantic_pass_types do this? - ((class symbol*) - ((class print_format*) - ((class expr_statement*) - ((class block*)dps[0]->body)->statements[0])->value)->args[0])->type = g_sym->type; } else // Array { @@ -1283,44 +1274,28 @@ 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; - block *b = new block; fe->base = g_sym; fe->block = (statement*)feb; b->statements.push_back(fe); - p->body = b; - - derive_probes (s, p, dps); - - // Repopulate the type info. Should semantic_pass_types do this? - print_format* dpf = ((print_format*) - ((expr_statement*) - ((foreach_loop*) - ((block*)dps[0]->body)->statements[0])->block)->value); - for (int i=0; i < idx_count; i++) - { - // printf argument types - dpf->args[i]->type = l->index_types[i]; - // arrayindex indices types - ((struct arrayindex*)dpf->args[idx_count])->indexes[i]->type = l->index_types[i]; - dps[0]->locals.push_back(idx_v[i]); - } - // arrayindex type - dpf->args[idx_count]->type = l->type; } - symresolution_info sym (s); - sym.current_function = 0; - sym.current_probe = dps[0]; - dps[0]->body->visit (& sym); - // Add created probe + p->body = b; + derive_probes (s, p, dps); for (unsigned i = 0; i < dps.size(); i++) { derived_probe* dp = dps[i]; s.probes.push_back (dp); dp->join_group (s); } + // Repopulate symbol and type info + symresolution_info sym (s); + sym.current_function = 0; + sym.current_probe = dps[0]; + dps[0]->body->visit (& sym); + semantic_pass_types(s); + // Mark that variable is read vut.read.insert (l); } } |