Mercurial > hg > octave-jordi
diff libinterp/corefcn/debug.cc @ 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 (2014-01-07) |
parents | f1b59ef34eda |
children | 73f81a7509a2 c1ce43276b86 |
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 ();