]> sourceware.org Git - systemtap.git/commitdiff
Use a real session flag for -L
authorJosh Stone <jistone@redhat.com>
Wed, 29 Jul 2009 19:35:29 +0000 (12:35 -0700)
committerJosh Stone <jistone@redhat.com>
Wed, 29 Jul 2009 19:35:29 +0000 (12:35 -0700)
Rather than relying on 'unoptimized' to tell us that the listing mode
should print the variables too, this adds an explicit listing_mode_vars.

* session.h (systemtap_session): Add listing_mode_vars
* main.cxx (main): Set s.listing_mode_vars appropriately.
  (printscript): Use the new flag for deciding whether to print locals

main.cxx
session.h

index 9dc658ffc708fc61b6ef16d9542c4242c2ed86bd..6a9444de36a5af7521346517bf8cbf735bd75887 100644 (file)
--- a/main.cxx
+++ b/main.cxx
@@ -193,16 +193,17 @@ printscript(systemtap_session& s, ostream& o)
             {
               o << pp;
               // Print the locals for -L mode only
-              if (s.unoptimized) {
-                for (unsigned j=0; j<p->locals.size(); j++)
-                  {
-                    o << " ";
-                    vardecl* v = p->locals[j];
-                    v->printsig (o);
-                  }
-                // Print arguments of probe if there
-                p->printargs(o);
-               }
+              if (s.listing_mode_vars)
+                {
+                  for (unsigned j=0; j<p->locals.size(); j++)
+                    {
+                      o << " ";
+                      vardecl* v = p->locals[j];
+                      v->printsig (o);
+                    }
+                  // Print arguments of probe if there
+                  p->printargs(o);
+                }
               o << endl;
               seen.insert (pp);
             }
@@ -377,6 +378,7 @@ main (int argc, char * const argv [])
   s.unoptimized = false;
   s.suppress_warnings = false;
   s.listing_mode = false;
+  s.listing_mode_vars = false;
 
 #ifdef ENABLE_PROLOGUES
   s.prologue_searching = true;
@@ -665,6 +667,7 @@ main (int argc, char * const argv [])
           break;
 
         case 'L':
+          s.listing_mode_vars = true;
           s.unoptimized = true; // This causes retention of variables for listing_mode
 
         case 'l':
index e68cd6dfa04d5b5971277a5bca8c0e64244f1cf3..cd12f49514a72c7440147cb0e9ab0689e548b7cc 100644 (file)
--- a/session.h
+++ b/session.h
@@ -103,6 +103,7 @@ struct systemtap_session
   bool keep_tmpdir;
   bool guru_mode;
   bool listing_mode;
+  bool listing_mode_vars;
   bool bulk_mode;
   bool unoptimized;
   bool merge;
This page took 0.03351 seconds and 5 git commands to generate.