Mercurial > octave-nkf
comparison libinterp/corefcn/debug.cc @ 18440: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 |
parents | 7cefc77f0be2 |
children | 0f9c5a15c8fa |
comparison
equal
deleted
inserted
replaced
18439:d5aa615dcf4c | 18440:96a495813047 |
---|---|
1222 else if (len) | 1222 else if (len) |
1223 print_usage (); | 1223 print_usage (); |
1224 | 1224 |
1225 if (! error_state) | 1225 if (! error_state) |
1226 { | 1226 { |
1227 octave_map stk = octave_call_stack::backtrace (nskip, curr_frame); | |
1228 | |
1229 if (nargout == 0) | 1227 if (nargout == 0) |
1230 { | 1228 { |
1229 octave_map stk = octave_call_stack::backtrace (nskip, curr_frame); | |
1231 octave_idx_type nframes_to_display = stk.numel (); | 1230 octave_idx_type nframes_to_display = stk.numel (); |
1232 | 1231 |
1233 if (nframes_to_display > 0) | 1232 if (nframes_to_display > 0) |
1234 { | 1233 { |
1235 octave_preserve_stream_state stream_state (os); | 1234 octave_preserve_stream_state stream_state (os); |
1271 os << " --> top level" << std::endl; | 1270 os << " --> top level" << std::endl; |
1272 } | 1271 } |
1273 } | 1272 } |
1274 else | 1273 else |
1275 { | 1274 { |
1275 octave_map stk = octave_call_stack::backtrace (nskip, | |
1276 curr_frame, | |
1277 false); | |
1278 | |
1276 retval(1) = curr_frame < 0 ? 1 : curr_frame + 1; | 1279 retval(1) = curr_frame < 0 ? 1 : curr_frame + 1; |
1277 retval(0) = stk; | 1280 retval(0) = stk; |
1278 } | 1281 } |
1279 } | 1282 } |
1280 | 1283 |