Mercurial > hg > octave-shane
changeset 9990:2b008f1d3794
octave_call_stack::do_goto_frame_relative: stop searching at top frame
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 15 Dec 2009 16:02:48 -0500 |
parents | d36f8c473dff |
children | 1300d9ced492 |
files | src/ChangeLog src/toplev.cc |
diffstat | 2 files changed, 19 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-12-15 John W. Eaton <jwe@octave.org> + + * toplev.cc (do_goto_frame_relative): Stop searching at top + stack frame even though it is not a function. + 2009-12-15 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/cellfun.cc (Fcellfun): Preserve original nargout. Call
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -387,7 +387,7 @@ octave_function *f = elt.fcn; - if (f && f->is_user_code ()) + if (frame == 0 || (f && f->is_user_code ())) { if (nskip > 0) nskip--; @@ -403,18 +403,20 @@ if (verbose) { - tree_statement *s = elt.stmt; - int l = -1; - int c = -1; - if (s) - { - l = s->line (); - c = s->column (); - } + std::ostringstream buf; + + if (f) + { + tree_statement *s = elt.stmt; - std::ostringstream buf; - buf << f->name () << ": " << " line " << l - << ", column " << c << std::endl; + int l = s ? s->line () : -1; + int c = s ? s->column () : -1; + + buf << f->name () << ": " << " line " << l + << ", column " << c << std::endl; + } + else + buf << "at top level" << std::endl; octave_stdout << buf.str (); }