]> sourceware.org Git - systemtap.git/commitdiff
PR11504 part: remove synthetic probe_NNNN name from error messages and most diagnostics
authorFrank Ch. Eigler <fche@elastic.org>
Mon, 3 May 2010 19:24:46 +0000 (15:24 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Mon, 3 May 2010 19:26:58 +0000 (15:26 -0400)
* elaborate.cxx (typeresolution_info::visit_target_symbol): Use
  sole_location as opposed to derived_probe name.
  (unresolved, invalid, mismatch): Remove the name/etc. prefix, as token
  context is available.
* translate.cxx (emit_lock_decls): Print sole_location here too.

elaborate.cxx
translate.cxx

index 5c6b0b4c4c555ab56c2ea94b610a1c061f415a0f..9b2f122398b5f5f0b4defa4ed7a1cad34df883cc 100644 (file)
@@ -4278,7 +4278,7 @@ typeresolution_info::visit_target_symbol (target_symbol* e)
         }
       else if (current_probe)
         {
-          clog << "probe " << current_probe->name << endl;
+          clog << "probe " << *current_probe->sole_location() << endl;
           current_probe->body->print (clog);
           clog << endl;
         }
@@ -4890,10 +4890,7 @@ typeresolution_info::unresolved (const token* tok)
   if (assert_resolvability)
     {
       stringstream msg;
-      string nm = (current_function ? current_function->name :
-                   current_probe ? current_probe->name :
-                   "probe condition");
-      msg << nm + " with unresolved type";
+      msg << "unresolved type ";
       session.print_error (semantic_error (msg.str(), tok));
     }
 }
@@ -4907,13 +4904,10 @@ typeresolution_info::invalid (const token* tok, exp_type pe)
   if (assert_resolvability)
     {
       stringstream msg;
-      string nm = (current_function ? current_function->name :
-                   current_probe ? current_probe->name :
-                   "probe condition");
       if (tok && tok->type == tok_operator)
-        msg << nm + " uses invalid operator";
+        msg << "invalid operator";
       else
-        msg << nm + " with invalid type " << pe;
+        msg << "invalid type " << pe;
       session.print_error (semantic_error (msg.str(), tok));
     }
 }
@@ -4946,10 +4940,7 @@ typeresolution_info::mismatch (const token* tok, exp_type t1, exp_type t2)
        }
       if (!tok_resolved)
        {
-         string nm = (current_function ? current_function->name :
-                      current_probe ? current_probe->name :
-                      "probe condition");
-         msg << nm + " with type mismatch (" << t1 << " vs. " << t2 << ")";
+         msg << "type mismatch (" << t1 << " vs. " << t2 << ")";
        }
       else
        {
@@ -4962,16 +4953,13 @@ typeresolution_info::mismatch (const token* tok, exp_type t1, exp_type t2)
                  break;
                }
            }
-         string nm = (current_function ? current_function->name :
-                      current_probe ? current_probe->name :
-                      "probe condition");
-         msg << nm + " with type mismatch (" << t1 << " vs. " << t2 << ")";
+         msg << "type mismatch (" << t1 << " vs. " << t2 << ")";
          if (!tok_printed)
            {
              //error for possible mismatch in the earlier resolved token
              printed_toks.push_back (resolved_toks[i]);
              stringstream type_msg;
-             type_msg << nm + " type first inferred here (" << t2 << ")";
+             type_msg << "type was first inferred here (" << t2 << ")";
              err1 = new semantic_error (type_msg.str(), resolved_toks[i]);
            }
        }
index 271bf789354d2c030b59596ceda4940b11bf7319..c701aedcaa9ffb4b753b77f012b89b31bd70522e 100644 (file)
@@ -1765,7 +1765,7 @@ c_unparser::emit_lock_decls(const varuse_collecting_visitor& vut)
   unsigned numvars = 0;
 
   if (session->verbose > 1)
-    clog << current_probe->name << " locks ";
+    clog << "probe " << *current_probe->sole_location() << " locks ";
 
   o->newline() << "static const struct stp_probe_lock locks[] = {";
   o->indent(1);
This page took 0.051576 seconds and 5 git commands to generate.