Mercurial > hg > octave-nkf
changeset 18235:0806c9e75e08 stable
strip .m when setting or clearing breakpoints (bug #41126)
* debug.cc (get_user_code): If name ends in .m, strip it.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 07 Jan 2014 15:00:11 -0500 |
parents | faf32a725693 |
children | f26d527c1a71 |
files | libinterp/corefcn/debug.cc |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc +++ b/libinterp/corefcn/debug.cc @@ -178,7 +178,14 @@ dbg_fcn = octave_call_stack::caller_user_code (); else { - octave_value fcn = symbol_table::find_function (fname); + std::string name = fname; + + size_t name_len = name.length (); + + if (! name.empty () && name_len > 2 && name.substr (name_len-2) == ".m") + name = name.substr (0, name_len-2); + + octave_value fcn = symbol_table::find_function (name); if (fcn.is_defined () && fcn.is_user_code ()) dbg_fcn = fcn.user_code_value ();