]> sourceware.org Git - systemtap.git/commitdiff
dwflpp: Return the value of stores for reuse
authorJosh Stone <jistone@redhat.com>
Wed, 14 May 2014 01:28:57 +0000 (18:28 -0700)
committerJosh Stone <jistone@redhat.com>
Wed, 14 May 2014 01:28:57 +0000 (18:28 -0700)
This allows assignments to pass their value on to more expressions, e.g.
"$foo = $bar = 42" assigns both to 42, or "println(($foo = $bar)$)" both
assigns "$foo" and pretty-prints the value.

dwflpp.cxx

index 2a2c9028d1116f7560e02da8a430014b647bfa9c..4fc7d5d4c85a240cf67f6a19a9a91b8860a393e9 100644 (file)
@@ -3195,7 +3195,7 @@ dwflpp::translate_final_fetch_or_store (struct obstack *pool,
                                         bool lvalue,
                                         const target_symbol *e,
                                         string &,
-                                        string &,
+                                        string & postlude,
                                         Dwarf_Die *typedie)
 {
   /* First boil away any qualifiers associated with the type DIE of
@@ -3304,6 +3304,9 @@ dwflpp::translate_final_fetch_or_store (struct obstack *pool,
           }
       break;
     }
+
+  if (lvalue)
+    postlude += "  STAP_RETVALUE = STAP_ARG_value;\n";
 }
 
 
This page took 0.036169 seconds and 5 git commands to generate.