diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | tapsets.cxx | 10 | ||||
-rw-r--r-- | testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | testsuite/systemtap.base/cmd_parse.exp | 3 | ||||
-rw-r--r-- | translate.cxx | 3 |
5 files changed, 28 insertions, 1 deletions
@@ -3,6 +3,15 @@ * configure.ac: Bump version to 0.7. * configure: Regenerated. +2008-03-27 Frank Ch. Eigler <fche@elastic.org> + + * tapsets.cxx (common_probe_entryfn_prologue): Clear last_stmt. + +2008-03-26 Frank Ch. Eigler <fche@elastic.org> + + * translate.cxx (emit_function): Set context last_stmt, in case + an error occurs during the function. + 2008-03-25 Frank Ch. Eigler <fche@elastic.org> * stap.1.in: Clarify utility of epilogue type probe aliases. diff --git a/tapsets.cxx b/tapsets.cxx index a9db3717..079d87e8 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -201,6 +201,7 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->newline() << "goto probe_epilogue;"; o->newline(-1) << "}"; o->newline(); + o->newline() << "c->last_stmt = 0;"; o->newline() << "c->last_error = 0;"; o->newline() << "c->nesting = 0;"; o->newline() << "c->regs = 0;"; @@ -1587,6 +1588,15 @@ struct dwflpp unsigned i = 0; while (i < components.size()) { + /* XXX: This would be desirable, but we don't get the target_symbol token, + and printing that gives us the file:line number too early anyway. */ +#if 0 + // Emit a marker to note which field is being access-attempted, to give + // better error messages if deref() fails. + string piece = string(...target_symbol token...) + string ("#") + stringify(components[i].second); + obstack_printf (pool, "c->last_stmt = %s;", lex_cast_qstring(piece).c_str()); +#endif + die = dwarf_formref_die (attr_mem, die_mem); const int typetag = dwarf_tag (die); switch (typetag) diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 6b988a7d..da789127 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -3,6 +3,10 @@ * configure.ac: Bump version to 0.7. * configure: Regenerated. +2008-03-27 Frank Ch. Eigler <fche@elastic.org> + + * systemtap.base/cmd_parse.exp: Don't assume $SHELL=bash. + 2008-03-23 Frank Ch. Eigler <fche@elastic.org> * lib/stap_run.exp (stap_run): Ignore missing debuginfo warnings. diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp index cf15698f..ff347a9d 100644 --- a/testsuite/systemtap.base/cmd_parse.exp +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -56,7 +56,8 @@ expect { wait #stap -c '(((a=42+7)); echo "The answer is $a")' -e 'probe begin {}' -spawn stap -c {(((a=42+7)); echo "The answer is $a")} -e {probe begin {}} +# NB: not ((a=42+7)) - must not assume bash +spawn stap -c {(a=49; echo "The answer is $a")} -e {probe begin {}} expect { -timeout 60 "The answer is 49" {pass "cmd_parse6"} diff --git a/translate.cxx b/translate.cxx index 2bfacefc..f30fca7b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1360,6 +1360,9 @@ c_unparser::emit_function (functiondecl* v) o->newline() << "#define THIS l"; o->newline() << "if (0) goto out;"; // make sure out: is marked used + // set this, in case embedded-c code sets last_error but doesn't otherwise identify itself + o->newline() << "c->last_stmt = " << lex_cast_qstring(*v->tok) << ";"; + // check/increment nesting level o->newline() << "if (unlikely (c->nesting+2 >= MAXNESTING)) {"; o->newline(1) << "c->last_error = \"MAXNESTING exceeded\";"; |