From ed10c6397cc27ad161c7fcd5242c38efd89dc5ee Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 28 Sep 2005 21:23:12 +0000 Subject: 2005-09-28 Frank Ch. Eigler PR 1182. * main.cxx (main): Support -D macro-setting option. * stap.1.in: Document it and related macros. * buildrun.cxx (compile_pass): Emit macro definitions. * translate.cxx (translate_pass): Guard limit macros with #ifdef. Eliminate MAXCONCURRENCY macro. * elaborate.h (systemtap_session): Add "macros" field. * parse.cxx (parse_if_statement): Clear "elseblock" if needed. 2005-09-28 Frank Ch. Eigler PR 1182. * systemtap.samples/control_limits.*: New test. --- buildrun.cxx | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'buildrun.cxx') diff --git a/buildrun.cxx b/buildrun.cxx index 130f4a1b..598d7110 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -20,6 +20,26 @@ extern "C" { using namespace std; +// return as quoted string, with at least '"' backslash-escaped +template inline string +lex_cast_qstring(IN const & in) +{ + stringstream ss; + string out, out2; + if (!(ss << in)) + throw runtime_error("bad lexical cast"); + out = ss.str(); + out2 += '"'; + for (unsigned i=0; i