changeset 18221:6ef8b920a7d6 gui-release

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.
author Stefan Mahr <dac922@gmx.de>
date Tue, 20 Aug 2013 18:57:48 +0200
parents 7adbc822065a
children 4d90e104bf35
files libinterp/corefcn/error.cc libinterp/corefcn/error.h libinterp/parse-tree/pt-eval.cc
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)
 {
--- 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 <cstdarg>
 #include <string>
 
+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);
 
--- 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);