summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authorfche <fche>2006-04-25 17:58:28 +0000
committerfche <fche>2006-04-25 17:58:28 +0000
commitbdef2583fcf7270a613cc992772bc1a36f98cabb (patch)
treed442307e36beb79c08c05fbbe36874c3ac652a0a /elaborate.cxx
parent1b07c728305a32a8d1fa1bb5da9d428e34dddf4e (diff)
downloadsystemtap-steved-bdef2583fcf7270a613cc992772bc1a36f98cabb.tar.gz
systemtap-steved-bdef2583fcf7270a613cc992772bc1a36f98cabb.tar.xz
systemtap-steved-bdef2583fcf7270a613cc992772bc1a36f98cabb.zip
2006-04-25 Frank Ch. Eigler <fche@elastic.org>
* elaborate.cxx (typeresolution_info::unresolved,invalid, mismatch): Print current function/probe name in error message. (semantic_pass_types): Pass sufficient information. * elaborate.h: Corresponding changes.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index 976becd6..f5b0496b 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1559,6 +1559,7 @@ semantic_pass_types (systemtap_session& s)
for (unsigned j=0; j<s.functions.size(); j++)
{
functiondecl* fn = s.functions[j];
+ ti.current_probe = 0;
ti.current_function = fn;
ti.t = pe_unknown;
fn->body->visit (& ti);
@@ -1574,6 +1575,7 @@ semantic_pass_types (systemtap_session& s)
{
derived_probe* pn = s.probes[j];
ti.current_function = 0;
+ ti.current_probe = pn;
ti.t = pe_unknown;
pn->body->visit (& ti);
}
@@ -1601,6 +1603,13 @@ semantic_pass_types (systemtap_session& s)
}
+
+typeresolution_info::typeresolution_info (systemtap_session& s):
+ session(s), current_function(0), current_probe(0)
+{
+}
+
+
void
typeresolution_info::visit_literal_number (literal_number* e)
{
@@ -2423,7 +2432,10 @@ typeresolution_info::unresolved (const token* tok)
if (assert_resolvability)
{
- cerr << "semantic error: unresolved type for ";
+ string nm = (current_function ? current_function->name :
+ current_probe ? current_probe->name :
+ "?");
+ cerr << "semantic error: " + nm + " with unresolved type for ";
if (tok)
cerr << *tok;
else
@@ -2440,7 +2452,10 @@ typeresolution_info::invalid (const token* tok, exp_type pe)
if (assert_resolvability)
{
- cerr << "semantic error: invalid type " << pe << " for ";
+ 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;
else
@@ -2457,7 +2472,10 @@ typeresolution_info::mismatch (const token* tok, exp_type t1, exp_type t2)
if (assert_resolvability)
{
- cerr << "semantic error: type mismatch for ";
+ string nm = (current_function ? current_function->name :
+ current_probe ? current_probe->name :
+ "?");
+ cerr << "semantic error: " + nm + " with type mismatch for ";
if (tok)
cerr << *tok;
else