From 66d284f47e7ce141ef6325d16f855dc27c05535a Mon Sep 17 00:00:00 2001 From: fche Date: Sun, 28 Aug 2005 15:21:00 +0000 Subject: 2005-08-28 Frank Ch. Eigler * translate.cxx (visit_target): Make target variable exceptions more informative. (literal_stmt_for_local): Improve bad-type exception message. * translate.cxx (emit_module_init): Include probe point in comments. --- ChangeLog | 7 +++++++ tapsets.cxx | 23 ++++++++++++++++------- translate.cxx | 2 ++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 872f83cf..ac731f4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-28 Frank Ch. Eigler + + * translate.cxx (visit_target): Make target variable exceptions + more informative. + (literal_stmt_for_local): Improve bad-type exception message. + * translate.cxx (emit_module_init): Include probe point in comments. + 2005-08-27 Roland McGrath * loc2c-test.c (print_type): New function. diff --git a/tapsets.cxx b/tapsets.cxx index b99e570f..632bd389 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -892,11 +892,11 @@ dwflpp string prelude, postlude; switch (typetag) { - default: - throw semantic_error ("target location not a base or pointer type"); + throw semantic_error ("unsupported type tag " + + lex_cast(typetag)); break; - + case DW_TAG_base_type: ty = pe_long; c_translate_fetch (&pool, 1, module_bias, die, typedie, &tail, @@ -1715,10 +1715,19 @@ var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) functiondecl *fdecl = new functiondecl; embeddedcode *ec = new embeddedcode; ec->tok = e->tok; - ec->code = q.dw.literal_stmt_for_local(addr, - e->base_name.substr(1), - e->components, - fdecl->type); + try + { + ec->code = q.dw.literal_stmt_for_local(addr, + e->base_name.substr(1), + e->components, + fdecl->type); + } + catch (const semantic_error& er) + { + semantic_error er2 (er); + er2.tok1 = e->tok; + throw er2; + } fdecl->name = fname; fdecl->body = ec; q.sess.functions.push_back(fdecl); diff --git a/translate.cxx b/translate.cxx index d9d9840d..71241d00 100644 --- a/translate.cxx +++ b/translate.cxx @@ -657,6 +657,8 @@ c_unparser::emit_module_init () for (unsigned i=0; iprobes.size(); i++) { o->newline() << "/* register " << i << " */"; + for (unsigned k=0; kprobes[i]->locations.size(); k++) + o->newline() << "/* " << *session->probes[i]->locations[k] << " */"; session->probes[i]->emit_registrations (o, i); o->newline() << "if (unlikely (rc)) {"; -- cgit