+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.
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;
}
}
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);
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: