diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | elaborate.cxx | 15 | ||||
-rw-r--r-- | tapsets.cxx | 15 |
3 files changed, 30 insertions, 5 deletions
@@ -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. diff --git a/elaborate.cxx b/elaborate.cxx index 04eb1fa2..be0cfcec 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -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; } } diff --git a/tapsets.cxx b/tapsets.cxx index 9fe3fba7..d05b548a 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -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: |