diff options
author | Josh Stone <jistone@redhat.com> | 2009-04-06 16:11:30 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-04-06 16:48:11 -0700 |
commit | 3e3bd7b6b9dd2ba282990f39d60e3ad5ecfec023 (patch) | |
tree | f103f40f27ccc9ef67cd9780a7bb307a7d43bb53 /translate.cxx | |
parent | b4c34c261909065b97dfccfd6df996897457193c (diff) | |
download | systemtap-steved-3e3bd7b6b9dd2ba282990f39d60e3ad5ecfec023.tar.gz systemtap-steved-3e3bd7b6b9dd2ba282990f39d60e3ad5ecfec023.tar.xz systemtap-steved-3e3bd7b6b9dd2ba282990f39d60e3ad5ecfec023.zip |
PR10026: Read marker/tracepoint args directly
We already stash the context variables for markers and tracepoints into
the locals for the probe body, but then we were using separate functions
to read those locals for each particular probe body.
This patch instead teaches the unparser how to emit the local name
directly for those context variables. The resulting code from the
translator is much simpler now.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/translate.cxx b/translate.cxx index cab37487..c42097bb 100644 --- a/translate.cxx +++ b/translate.cxx @@ -918,6 +918,7 @@ c_unparser::emit_common_header () ostringstream oss; oss << "c->statp = & time_" << dp->basest()->name << ";" << endl; // -t anti-dupe oss << "# needs_global_locks: " << dp->needs_global_locks () << endl; + dp->print_dupe_stamp (oss); dp->body->print(oss); // NB: dependent probe conditions *could* be listed here, but don't need to be. // That's because they're only dependent on the probe body, which is already @@ -1507,6 +1508,7 @@ c_unparser::emit_probe (derived_probe* v) // be very different with or without -t. oss << "c->statp = & time_" << v->basest()->name << ";" << endl; + v->print_dupe_stamp (oss); v->body->print(oss); // Since the generated C changes based on whether or not the probe @@ -3488,7 +3490,10 @@ c_unparser_assignment::visit_symbol (symbol *e) void c_unparser::visit_target_symbol (target_symbol* e) { - throw semantic_error("cannot translate general target-symbol expression", e->tok); + if (!e->probe_context_var.empty()) + o->line() << "l->" << e->probe_context_var; + else + throw semantic_error("cannot translate general cast expression", e->tok); } |