From 177a8ead26e48a61efd904103a9d189cb27009dd Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 1 Nov 2005 16:13:35 +0000 Subject: 2005-11-01 Frank Ch. Eigler PR 1425. * configure.ac: Look for rpm-devel headers and libs. * configure: Regenerated. * session.h: New file to contain systemtap_session decl. * staptree.h: Likewise evict statistics_decl. * elaborate.h: Corresponding changes. * main.cxx (usage): Elaborate. Re-enable "-r RELEASE" option. * parse.cxx (parser): Add systemtap_session& field. Update users. (scan_pp, eval_pp_conditional): New routines for preprocessing. (peek, next): Call it. (lexer::scan): Lex the preprocessor operators. (parser::parse): Include an extra level of exception catching for parse errors that occur during recovery. * parse.h: Corresponding changes. (parse_error): Allow explicit token parameter. * stap.1.in: Document preprocessing. * testsuite/parseok/fourteen.stp: New test. --- main.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index ca9bfc69..cd641588 100644 --- a/main.cxx +++ b/main.cxx @@ -63,8 +63,10 @@ usage (systemtap_session& s) // << " -t test mode" << (s.test_mode ? " [set]" : "") << endl << " -g guru mode" << (s.guru_mode ? " [set]" : "") << endl << " -b bulk (relayfs) mode" << (s.bulk_mode ? " [set]" : "") << endl - << " -s NUM buffer size in megabytes" << endl - << " -p NUM stop after pass NUM 1-5" << endl + << " -s NUM buffer size in megabytes, instead of " + << s.buffer_size << endl + << " -p NUM stop after pass NUM 1-5, instead of " + << s.last_pass << endl << " (parse, elaborate, translate, compile, run)" << endl << " -I DIR look in DIR for additional .stp script files"; if (s.include_path.size() == 0) @@ -77,11 +79,11 @@ usage (systemtap_session& s) << " -D NM=VAL emit macro definition into generated C code" << endl << " -R DIR look in DIR for runtime, instead of" << endl << " " << s.runtime_path << endl - // << " -r RELEASE use kernel RELEASE, instead of" << endl - // << " " << s.kernel_release << endl + << " -r RELEASE use kernel RELEASE, instead of " + << s.kernel_release << endl << " -m MODULE set probe module name, instead of " << s.module_name << endl - << " -o FILE send output to file instead of stdout" << endl + << " -o FILE send output to file, instead of stdout" << endl << " -c CMD start the probes, run CMD, and exit when it finishes" << endl << " -x PID sets target() to PID" << endl @@ -289,13 +291,13 @@ main (int argc, char * const argv []) // XXX: pass args vector, so parser (or lexer?) can substitute // $1..$NN with actual arguments if (script_file == "-") - s.user_file = parser::parse (cin, s.guru_mode); + s.user_file = parser::parse (s, cin, s.guru_mode); else if (script_file != "") - s.user_file = parser::parse (script_file, s.guru_mode); + s.user_file = parser::parse (s, script_file, s.guru_mode); else { istringstream ii (cmdline_script); - s.user_file = parser::parse (ii, s.guru_mode); + s.user_file = parser::parse (s, ii, s.guru_mode); } if (s.user_file == 0) // syntax errors already printed @@ -338,7 +340,7 @@ main (int argc, char * const argv []) for (unsigned j=0; j