From b8da0ad19d9dfcf88c4cd6dcf7b8aa73fc5016d7 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 30 Mar 2007 19:17:02 +0000 Subject: 2007-03-30 Frank Ch. Eigler PR 1570 * NEWS: Document probe handler language change re. inline functions. * stapprobes.5.in: Likewise. * tapsets.cxx: Many changes to simplify caches and implement new handling of inline functions, removed of stubs for future probes. * elaborate.cxx (derived_probe printsig_nested): New function. * elaborate.h: Declare it. * main.cxx (usage): Clarify "-r" meaning. (main): Tweak related "-p 4" message. 2007-03-30 Frank Ch. Eigler PR 1570. * memory.stp, scheduler.stp, signal.stp, LKET/signal.stp: Adapt to .inline -> .function change. 2007-03-30 Frank Ch. Eigler PR 1570 * */*.stp: Adapt to .inline -> .function change. * lib/stap_run.exp, stap_run2.exp, stap_run_binary.exp: Shorten pass/fail dejagnu log lines. * systemtap.syscall/sys.stp, test.tcl: Make slightly more compatible and failure more verbose. --- elaborate.cxx | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index be0cfcec..8ec376c0 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -62,8 +62,42 @@ derived_probe::derived_probe (probe *p, probe_point *l): } +void +derived_probe::printsig (ostream& o) const +{ + probe::printsig (o); + printsig_nested (o); +} + +void +derived_probe::printsig_nested (ostream& o) const +{ + // We'd like to enclose the probe derivation chain in a /* */ + // comment delimiter. But just printing /* base->printsig() */ is + // not enough, since base might itself be a derived_probe. So we, + // er, "cleverly" encode our nesting state as a formatting flag for + // the ostream. + ios::fmtflags f = o.flags (ios::internal); + if (f & ios::internal) + { + // already nested + o << " <- "; + base->printsig (o); + } + else + { + // outermost nesting + o << " /* <- "; + base->printsig (o); + o << " */"; + } + // restore flags + (void) o.flags (f); +} + + probe_point* -derived_probe::sole_location () +derived_probe::sole_location () const { if (locations.size() == 0) throw semantic_error ("derived_probe with no locations", this->tok); -- cgit