diff libinterp/corefcn/debug.cc @ 18439:96a495813047

Don't put parent function in subfunction stack structure name (bug #41506). * debug.cc (do_dbstack): When returning a structure, call octave_call_stack::backtrace with print_subfn set to false. * toplev.h (octave_call_stack::backtrace): Create new 2 argument function signature which calls do_backtrace with print_subfn set to true. Create new 3 argument function signature which passes print_subfn argument through to do_backtrace. * toplev.cc (octave_call_stack::do_backtrace): Change function to accept 3rd argument, print_subfn, which decides whether the parent function should be printed in the name field of the backtrace.
author Rik <rik@octave.org>
date Sat, 08 Feb 2014 14:44:21 -0800 (2014-02-08)
parents 7cefc77f0be2
children 0f9c5a15c8fa
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc
+++ b/libinterp/corefcn/debug.cc
@@ -1224,10 +1224,9 @@
 
   if (! error_state)
     {
-      octave_map stk = octave_call_stack::backtrace (nskip, curr_frame);
-
       if (nargout == 0)
         {
+          octave_map stk = octave_call_stack::backtrace (nskip, curr_frame);
           octave_idx_type nframes_to_display = stk.numel ();
 
           if (nframes_to_display > 0)
@@ -1273,6 +1272,10 @@
         }
       else
         {
+          octave_map stk = octave_call_stack::backtrace (nskip,
+                                                         curr_frame,
+                                                         false);
+
           retval(1) = curr_frame < 0 ? 1 : curr_frame + 1;
           retval(0) = stk;
         }