]> sourceware.org Git - systemtap.git/commitdiff
diagnostics: handle -vvvv better for staptrees mid-elision
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 3 Aug 2018 17:54:17 +0000 (13:54 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 3 Aug 2018 17:54:17 +0000 (13:54 -0400)
Several of the dead-statement type elision passes temporarily
substitute 0 pointers for actual staptree nodes.  If coupled with
-vvvv pretty-printing, these 0's had a way of triggering segvs.
Now more of these pretty-printers explicitly test for 0.

staptree.cxx
staptree.h
testsuite/buildok/syscalls-detailed.stp

index 73eb5d1cd9ec3b72f828629f21b537769527242a..8c791675da1909f8e685c77eec6ab00b9824712d 100644 (file)
@@ -1301,7 +1301,10 @@ void null_statement::print (ostream& o) const
 
 void expr_statement::print (ostream& o) const
 {
-  o << *value;
+  if (value)
+    o << *value;
+  else
+    o << ";"; /* mid-elision-pass null-statement */
 }
 
 
@@ -1333,8 +1336,8 @@ void continue_statement::print (ostream& o) const
 
 void if_statement::print (ostream& o) const
 {
-  o << "if (" << *condition << ") "
-    << *thenblock << endl;
+  o << "if (" << *condition << ") ";
+  if (thenblock) o << *thenblock; else o << ";"; o << endl;
   if (elseblock)
     o << "else " << *elseblock << endl;
 }
index 280ebdfa282dbf6da9969689de7ffada253e93f8..00c22f9f120262ec465b9f6f714dfd275b5c5083 100644 (file)
@@ -1290,9 +1290,9 @@ struct update_visitor: public visitor
            if (this->verbose > 3)
              {
                std::clog << _("replaced ");
-               old_src->print(std::clog);
+               if (old_src) old_src->print(std::clog); else std::clog << "0";
                std::clog << _(" with ");
-               new_src->print(std::clog);
+               if (new_src) new_src->print(std::clog); else std::clog << "0";
                std::clog << std::endl;
              }
             relaxed_p = false;
index 2743d858ce78c8af1fa115b963229b580b36b74d..d6774e125b2d82ca1b5047efbd880ae533a2e620 100755 (executable)
@@ -1,4 +1,4 @@
-#! stap -Wp4
+#! stap -Wvvvvp4
 
 probe syscall.accept
 {
This page took 0.036137 seconds and 5 git commands to generate.