# HG changeset patch # User jpswensen@john-swensens-macbook-pro-15.local # Date 1227326030 18000 # Node ID 5798aa0f902a38d4484d21707976d454a1507752 # Parent 55b97f709203e9d920d39e46d1116a64fd2a544d [mq]: debug.patch diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-11-21 John Swensen + * debug.cc: Bugfix for symtab/debugger interactions. + 2008-11-18 John W. Eaton * mkoctfile.cc.in, octave-bug.cc.in: Style fixes. diff --git a/src/debug.cc b/src/debug.cc --- a/src/debug.cc +++ b/src/debug.cc @@ -304,19 +304,32 @@ { fname_line_map retval; + // Clear the breakpoints in the function if it has been updated. + // FIXME: This is a bad way of doing this, but I can't think of another. The + // problem is due to the fact that out_of_date_check(...) calls + // remove_breakpoints_in_file(...), which in turn modifies bp_map while we are + // in the middle of iterating through it. + std::list usercode_list; + for (breakpoint_map_iterator it = bp_map.begin (); it != bp_map.end (); it++) + { + octave_user_code *f = it->second; + usercode_list.push_back(f); + } + + for (std::list::iterator it = usercode_list.begin (); it != usercode_list.end (); it++) + { + out_of_date_check(*it); + } + + // Iterate through each of the files in the map and get the // name and list of breakpoints. - for (breakpoint_map_iterator it = bp_map.begin (); it != bp_map.end (); it++) { if (fname_list.length () == 0 || do_find_bkpt_list (fname_list, it->first) != "") { octave_user_code *f = it->second; - - // Clears the breakpoints if the function has been updated - out_of_date_check (f); - tree_statement_list *cmds = f->body (); if (cmds)