Mercurial > hg > octave-jordi
comparison src/debug.cc @ 8123:eb2beef9a9ff
clear breakpoints is function found to be out of date
author | David Bateman <dbateman@free.fr> |
---|---|
date | Mon, 22 Sep 2008 13:11:32 -0400 |
parents | cbbea37b95e8 |
children | 6f2d95255911 |
comparison
equal
deleted
inserted
replaced
8122:99602635172a | 8123:eb2beef9a9ff |
---|---|
70 dbg_fcn = octave_call_stack::caller_user_code (); | 70 dbg_fcn = octave_call_stack::caller_user_code (); |
71 else | 71 else |
72 { | 72 { |
73 octave_value fcn = symbol_table::find_function (fname); | 73 octave_value fcn = symbol_table::find_function (fname); |
74 | 74 |
75 if (fcn.is_defined ()) | 75 if (fcn.is_defined () && fcn.is_user_code ()) |
76 dbg_fcn = fcn.user_code_value (); | 76 dbg_fcn = fcn.user_code_value (); |
77 } | 77 } |
78 | 78 |
79 return dbg_fcn; | 79 return dbg_fcn; |
80 } | 80 } |
236 return retval; | 236 return retval; |
237 } | 237 } |
238 | 238 |
239 | 239 |
240 bp_table::intmap | 240 bp_table::intmap |
241 bp_table::do_remove_all_breakpoints_in_file (const std::string& fname) | 241 bp_table::do_remove_all_breakpoints_in_file (const std::string& fname, |
242 bool silent) | |
242 { | 243 { |
243 intmap retval; | 244 intmap retval; |
244 | 245 |
245 octave_user_code *dbg_fcn = get_user_code (fname); | 246 octave_user_code *dbg_fcn = get_user_code (fname); |
246 | 247 |
263 | 264 |
264 if (it != bp_map.end ()) | 265 if (it != bp_map.end ()) |
265 bp_map.erase (it); | 266 bp_map.erase (it); |
266 } | 267 } |
267 } | 268 } |
268 else | 269 else if (! silent) |
269 error ("remove_all_breakpoint_in_file: " | 270 error ("remove_all_breakpoint_in_file: " |
270 "unable to find the function requested\n"); | 271 "unable to find the function requested\n"); |
271 | 272 |
272 return retval; | 273 return retval; |
273 } | 274 } |
311 if (fname_list.length () == 0 | 312 if (fname_list.length () == 0 |
312 || do_find_bkpt_list (fname_list, it->first) != "") | 313 || do_find_bkpt_list (fname_list, it->first) != "") |
313 { | 314 { |
314 octave_user_code *f = it->second; | 315 octave_user_code *f = it->second; |
315 | 316 |
317 // Clears the breakpoints if the function has been updated | |
318 out_of_date_check (f); | |
319 | |
316 tree_statement_list *cmds = f->body (); | 320 tree_statement_list *cmds = f->body (); |
317 | 321 |
318 if (cmds) | 322 if (cmds) |
319 { | 323 { |
320 octave_value_list bkpts = cmds->list_breakpoints (); | 324 octave_value_list bkpts = cmds->list_breakpoints (); |
321 | 325 |
322 octave_idx_type len = bkpts.length (); | 326 octave_idx_type len = bkpts.length (); |
323 | 327 |
324 bp_table::intmap bkpts_vec; | 328 if (len > 0) |
325 | 329 { |
326 for (int i = 0; i < len; i++) | 330 bp_table::intmap bkpts_vec; |
327 bkpts_vec[i] = bkpts (i).double_value (); | 331 |
328 | 332 for (int i = 0; i < len; i++) |
329 retval[it->first] = bkpts_vec; | 333 bkpts_vec[i] = bkpts (i).double_value (); |
334 | |
335 retval[it->first] = bkpts_vec; | |
336 } | |
330 } | 337 } |
331 } | 338 } |
332 } | 339 } |
333 | 340 |
334 return retval; | 341 return retval; |