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 Tue Dec 22 12:43:33 2015 +1100 @@ -820,7 +820,9 @@ bp_table::do_get_breakpoint_list (const { fname_bp_map retval; - for (bp_set_iterator it = bp_set.begin (); it != bp_set.end (); it++) + std::set tmp_bp_set = bp_set; // copy, since may change below + + for (bp_set_iterator it = tmp_bp_set.begin (); it != tmp_bp_set.end (); it++) { if (fname_list.length () == 0 || do_find_bkpt_list (fname_list, *it) != "")