]> sourceware.org Git - systemtap.git/commitdiff
2007-03-26 David Smith <dsmith@redhat.com>
authordsmith <dsmith>
Mon, 26 Mar 2007 18:19:53 +0000 (18:19 +0000)
committerdsmith <dsmith>
Mon, 26 Mar 2007 18:19:53 +0000 (18:19 +0000)
* tapsets.cxx (dwflpp::translate_final_fetch_or_store): Improved
error messages for invalid types.

* elaborate.cxx (typeresolution_info::invalid): Improved the error
message for invalid operators.

ChangeLog
elaborate.cxx
tapsets.cxx

index 0d2a8732f0f32c7d8a5acf2bf80e74fb7b3de406..9ffbc12e3bd9204a6f96eddadb45f54df2209727 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-26  David Smith  <dsmith@redhat.com>
+
+       * elaborate.cxx (typeresolution_info::invalid): Improved the error
+       message for invalid operators.
+
 2007-03-22  Frank Ch. Eigler  <fche@elastic.org>
 
        PR 4224.
index 04eb1fa26319f035dfa85aa8114d18964e4a7764..be0cfceca24a8b8ce6fe730e09df6dd52d3a5d83 100644 (file)
@@ -2700,11 +2700,18 @@ typeresolution_info::invalid (const token* tok, exp_type pe)
       string nm = (current_function ? current_function->name :
                    current_probe ? current_probe->name :
                    "?");
-      cerr << "semantic error: " + nm + " with invalid type " << pe << " for ";
-      if (tok)
-        cerr << *tok;
+      if (tok && tok->type == tok_operator)
+        {
+         cerr << "semantic error: " + nm + " uses invalid " << *tok;
+        }
       else
-        cerr << "a token";
+        {
+         cerr << "semantic error: " + nm + " with invalid type " << pe << " for ";
+         if (tok)
+             cerr << *tok;
+         else
+             cerr << "a token";
+       }
       cerr << endl;
     }
 }
index 9fe3fba771c0deb1df2d8223b29280c1472fbeb5..d05b548adf655caa079022d966b506bb7b88afe9 100644 (file)
@@ -1624,6 +1624,8 @@ struct dwflpp
     Dwarf_Die typedie_mem;
     Dwarf_Die *typedie;
     int typetag;
+    char const *dname;
+    string diestr;
 
     typedie = resolve_unqualified_inner_typedie (&typedie_mem, attr_mem);
     typetag = dwarf_tag (typedie);
@@ -1634,8 +1636,19 @@ struct dwflpp
     switch (typetag)
       {
       default:
+       dname = dwarf_diename(die);
+       diestr = (dname != NULL) ? dname : "<unknown>";
        throw semantic_error ("unsupported type tag "
-                             + lex_cast<string>(typetag));
+                             + lex_cast<string>(typetag)
+                             + " for " + diestr);
+       break;
+
+      case DW_TAG_structure_type:
+      case DW_TAG_union_type:
+       dname = dwarf_diename(die);
+       diestr = (dname != NULL) ? dname : "<unknown>";
+       throw semantic_error ("struct/union '" + diestr
+                             + "' is being accessed instead of a member of the struct/union");
        break;
 
       case DW_TAG_enumeration_type:
This page took 0.043979 seconds and 5 git commands to generate.