diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | main.cxx | 24 | ||||
-rw-r--r-- | stap.1.in | 6 | ||||
-rw-r--r-- | tapsets.cxx | 32 |
4 files changed, 34 insertions, 34 deletions
@@ -1,5 +1,11 @@ 2005-08-10 Frank Ch. Eigler <fche@elastic.org> + * tapsets.cxx: Correct hex/decimal misformatting of verbose messages. + * main.cxx: Add formal "-h" and "-V" options. + * stap.1.in: Document them. + +2005-08-10 Frank Ch. Eigler <fche@elastic.org> + * tapsets.cxx: Move around "focusing on ..." messages to print them only for matching functions/modules. (dwflpp ctor): Also add cu (source file) name to derived @@ -30,14 +30,21 @@ using namespace std; void -usage (systemtap_session& s) +version () { clog << "SystemTap translator/driver " << "(version " << VERSION << " built " << DATE << ")" << endl << "Copyright (C) 2005 Red Hat, Inc." << endl << "This is free software; see the source for copying conditions." - << endl + << endl; +} + +void +usage (systemtap_session& s) +{ + version (); + clog << endl << "Usage: stap [options] FILE Run script in file." << endl @@ -46,9 +53,11 @@ usage (systemtap_session& s) << " or: stap [options] -e SCRIPT Run given script." << endl << endl - << "Arguments:" << endl + << "Options:" << endl << " -- no more options after this" << endl - << " -v verbose" << (s.verbose ? " [set]" : "") + << " -v verbose" << (s.verbose ? " [set]" : "") << endl + << " -h show help" << endl + << " -V show version" << endl << endl << " -k keep temporary directory" << endl // << " -t test mode" << (s.test_mode ? " [set]" : "") << endl @@ -123,11 +132,15 @@ main (int argc, char * const argv []) while (true) { - int grc = getopt (argc, argv, "vp:I:e:o:tR:r:m:kg"); + int grc = getopt (argc, argv, "hVvp:I:e:o:tR:r:m:kg"); if (grc < 0) break; switch (grc) { + case 'V': + version (); + exit (0); + case 'v': s.verbose = true; break; @@ -180,7 +193,6 @@ main (int argc, char * const argv []) s.guru_mode = true; break; - case '?': case 'h': default: usage (s); @@ -56,6 +56,12 @@ prints a list of supported options. .B \-v Verbose mode. Produces more informative output. .TP +.B \-h +Show help message. +.TP +.B \-V +Show version message. +.TP .B \-k Keep the temporary directory after all processing. This may be useful in order to examine the generated C code, or to reuse the compiled diff --git a/tapsets.cxx b/tapsets.cxx index ac936d95..a7f3f241 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -220,12 +220,6 @@ dwflpp function_name.clear(); function = NULL; - - if (false && sess.verbose) - clog << "focused on module '" << module_name - << "' = [" << hex << module_start - << " ," << hex << module_end - << "]" << endl; } @@ -240,10 +234,6 @@ dwflpp // Reset existing pointers and names function_name.clear(); function = NULL; - - if (false && sess.verbose) - clog << "focused on CU '" << cu_name - << "', in module '" << module_name << "'" << endl; } @@ -256,11 +246,6 @@ dwflpp function = f; function_name = default_name(dwarf_func_name(function), "function"); - - if (false && sess.verbose) - clog << "focused on function '" << function_name - << "', in CU '" << cu_name - << "', module '" << module_name << "'" << endl; } @@ -426,16 +411,12 @@ dwflpp void *), void * data) { - if (false && sess.verbose) - clog << "iterating over modules" << endl; ptrdiff_t off = 0; do { off = dwfl_getmodules (dwfl, callback, data, off); } while (off > 0); - if (false && sess.verbose) - clog << "finished iterating over modules" << endl; dwflpp_assert("getdwarf", off); } @@ -450,9 +431,6 @@ dwflpp return; } - if (false && sess.verbose) - clog << "iterating over CUs in module " << module_name << endl; - Dwarf *dw = module_dwarf; Dwarf_Off off = 0; size_t cuhl; @@ -473,8 +451,6 @@ dwflpp { assert(module); assert(cu); - if (false && sess.verbose) - clog << "iterating over functions in CU " << cu_name << endl; dwarf_getfuncs(cu, callback, data, 0); } @@ -598,8 +574,8 @@ dwflpp *addr = line_addr; if (sess.verbose) clog << "function " << function_name - << " entrypc: " << entrypc - << " prologue-end: " << line_addr + << " entrypc: " << hex << entrypc + << " prologue-end: " << line_addr << dec << endl; return true; } @@ -1176,8 +1152,8 @@ query_module (Dwfl_Module *mod __attribute__ ((unused)), if (q->sess.verbose) clog << "focused on module '" << q->dw.module_name << "' = [" << hex << q->dw.module_start - << " ," << hex << q->dw.module_end - << "]" << endl; + << "-" << q->dw.module_end + << ", bias " << q->dw.module_bias << "]" << dec << endl; if (q->has_function_num || q->has_statement_num) { |