From 35d4ab18d5d333ffcac436ea174beb7201275c65 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 21 Apr 2006 19:51:43 +0000 Subject: 2006-04-21 Frank Ch. Eigler PR 953 * elaborate.h (derived_probe): Add field "name". Stop passing "probe index" to other emit_* calls. (emit_probe_context_vars): New member function. * elaborate.cxx (derived_probe ctor): Generate unique name. * translate.cxx (*): Adapt to index->name. (emit_probe): Realize that probe locals only occur at nesting=0. * tapsets.cxx (*derived_probe::emit_*): Adapt to index->name. (mark_var_expanding_copy_visitor): New class to process $argN. (mark_derived_probe ctor): Call it. (mark_derived_probe::emit_probe_context_vars): Do it. * buildrun.cxx (compile_pass): Add more optional gcc verbosity. Add CFLAGS += -freorder-blocks. * testsuite/buildok/marker.stp: New test. --- elaborate.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'elaborate.h') diff --git a/elaborate.h b/elaborate.h index afaf8b18..7317e940 100644 --- a/elaborate.h +++ b/elaborate.h @@ -112,20 +112,23 @@ struct derived_probe: public probe derived_probe (probe* b, probe_point* l); probe* base; // the original parsed probe +private: + static unsigned last_probeidx; + +public: + std::string name; + virtual ~derived_probe () {} - virtual void emit_registrations (translator_output* o, - unsigned probeidx) = 0; + virtual void emit_registrations (translator_output* o) = 0; // (from within module_init): - // rc = ..... ENTRYFN ; + // rc = ..... register_or_whatever (ENTRYFN); - virtual void emit_deregistrations (translator_output* o, - unsigned probeidx) = 0; + virtual void emit_deregistrations (translator_output* o) = 0; // (from within module_exit): - // rc = ..... ENTRYFN ; + // (void) ..... unregister_or_whatever (ENTRYFN); - virtual void emit_probe_entries (translator_output* o, - unsigned probeidx) = 0; + virtual void emit_probe_entries (translator_output* o) = 0; // ... for all probe-points: // ELABORATE_SPECIFIC_SIGNATURE ENTRYFN { // /* allocate context - probe_prologue */ @@ -134,6 +137,11 @@ struct derived_probe: public probe // /* deallocate context - probe_epilogue */ // } + virtual void emit_probe_context_vars (translator_output* o) {} + // From within unparser::emit_common_header, add any extra variables + // to this probe's context locals. + +protected: void emit_probe_prologue (translator_output* o, const std::string&); void emit_probe_epilogue (translator_output* o); }; -- cgit