# HG changeset patch # User Stefan Mahr # Date 1377017868 -7200 # Node ID 6ef8b920a7d6a77b590e3b3a8c80b9e138b19dd4 # Parent 7adbc822065a858965093bd5f57b7facdbbfa1a5 include stack in exception variable (bug #41117) * error.h, error.cc (last_error_stack): New function. * pt-eval.cc (tree_evaluator::visit_try_catch_command): Include stack information in err variable. diff -r 7adbc822065a -r 6ef8b920a7d6 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Sat Jan 04 22:18:49 2014 +0100 +++ b/libinterp/corefcn/error.cc Tue Aug 20 18:57:48 2013 +0200 @@ -2011,6 +2011,12 @@ return Vlast_error_id; } +octave_map +last_error_stack (void) +{ + return Vlast_error_stack; +} + std::string last_warning_message (void) { diff -r 7adbc822065a -r 6ef8b920a7d6 libinterp/corefcn/error.h --- a/libinterp/corefcn/error.h Sat Jan 04 22:18:49 2014 +0100 +++ b/libinterp/corefcn/error.h Tue Aug 20 18:57:48 2013 +0200 @@ -26,6 +26,7 @@ #include #include +class octave_map; class octave_value_list; class unwind_protect; @@ -137,6 +138,7 @@ // Helper functions to pass last error and warning messages and ids extern OCTINTERP_API std::string last_error_message (void); extern OCTINTERP_API std::string last_error_id (void); +extern OCTINTERP_API octave_map last_error_stack (void); extern OCTINTERP_API std::string last_warning_message (void); extern OCTINTERP_API std::string last_warning_id (void); diff -r 7adbc822065a -r 6ef8b920a7d6 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Sat Jan 04 22:18:49 2014 +0100 +++ b/libinterp/parse-tree/pt-eval.cc Tue Aug 20 18:57:48 2013 +0200 @@ -936,6 +936,7 @@ err.assign ("message", last_error_message ()); err.assign ("identifier", last_error_id ()); + err.assign ("stack", last_error_stack ()); if (! error_state) ult.assign (octave_value::op_asn_eq, err);