]> sourceware.org Git - systemtap.git/commitdiff
2008-01-17 David Smith <dsmith@redhat.com>
authordsmith <dsmith>
Thu, 17 Jan 2008 20:44:34 +0000 (20:44 +0000)
committerdsmith <dsmith>
Thu, 17 Jan 2008 20:44:34 +0000 (20:44 +0000)
* tapsets.cxx
(perfmon_var_expanding_copy_visitor::visit_target_symbol): Print an
error when trying to use the perfmon target variable '$counter as
an array or structure.

ChangeLog
tapsets.cxx

index 619823128429d955598f244e9eba236df9d85a39..71cb20019cc9aced28d386b3deb7866273c2e048 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
        (procfs_var_expanding_copy_visitor::visit_target_symbol): Print an
        error when trying to use the procfs target variable '$value' as an
        array or structure.
+       (perfmon_var_expanding_copy_visitor::visit_target_symbol): Print an
+       error when trying to use the perfmon target variable '$counter as
+       an array or structure.
 
 2008-01-16  David Smith  <dsmith@redhat.com>
 
index 89819d6e17d2a9e768b659c6f187bbfcb2b459cd..84187960fd4ab0e81eaca5e35adc2ba30616628f 100644 (file)
@@ -5882,6 +5882,25 @@ perfmon_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
   if (e->base_name != "$counter")
     throw semantic_error ("target variables not available to perfmon probes");
 
+  if (e->components.size() > 0)
+    {
+      switch (e->components[0].first)
+       {
+       case target_symbol::comp_literal_array_index:
+         throw semantic_error("perfmon probe '$counter' variable may not be used as array",
+                              e->tok);
+         break;
+       case target_symbol::comp_struct_member:
+         throw semantic_error("perfmon probe '$counter' variable may not be used as a structure",
+                              e->tok);
+         break;
+       default:
+         throw semantic_error ("invalid use of perfmon probe '$counter' variable",
+                               e->tok);
+         break;
+       }
+    }
+
   ec->code = "THIS->__retvalue = _pfm_pmd_x[" + 
          lex_cast<string>(counter_number) + "].reg_num;";
   ec->code += "/* pure */";
This page took 0.038725 seconds and 5 git commands to generate.