diff -r 4929d0dd97d4 libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Mon Dec 21 12:53:18 2015 +1100 +++ b/libinterp/corefcn/debug.cc Mon Dec 21 21:21:15 2015 +1100 @@ -820,12 +820,19 @@ bp_table::do_get_breakpoint_list (const { fname_bp_map retval; - for (bp_set_iterator it = bp_set.begin (); it != bp_set.end (); it++) + bp_set_iterator it; + do { - if (fname_list.length () == 0 - || do_find_bkpt_list (fname_list, *it) != "") + bp_set_iterator begin = bp_set.begin (); + for (it = bp_set.begin (); it != bp_set.end (); it++) { + if (fname_list.length () != 0 + && do_find_bkpt_list (fname_list, *it) == "") + continue; + octave_user_code *f = get_user_code (*it); + if (begin != bp_set.begin ()) // check bp_set.end() valid + break; if (f) { @@ -877,7 +884,7 @@ bp_table::do_get_breakpoint_list (const } } } - } + } while (it != bp_set.end ()); return retval; }