# HG changeset patch # User John W. Eaton # Date 1280524768 14400 # Node ID 960065af9f0f7ebb9437d20a042798563f8d3d8f # Parent 6ea0cf31667d85cf5de3b8c1d913a3e6f424919f pt-bp.cc: more debugger fixes diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-07-30 John W. Eaton + + * pt-bp.cc (tree_breakpoint::take_action): Only call + delete_breakpoint if is_breakpoint returns true. + (tree_breakpoint::visit_statement): If statement is command, + accept it, otherwise, maybe take action on the statement. + (tree_breakpoint::visit_no_op_command): Handle breakpoints at + end of function. + Addresses more problems found with bug #30490. + 2010-07-30 Rik * Makefile.am: add .DOCSTRINGS to the DISTCLEANFILES list diff --git a/src/pt-bp.cc b/src/pt-bp.cc --- a/src/pt-bp.cc +++ b/src/pt-bp.cc @@ -274,8 +274,10 @@ } void -tree_breakpoint::visit_no_op_command (tree_no_op_command&) +tree_breakpoint::visit_no_op_command (tree_no_op_command& cmd) { + if (cmd.is_end_of_fcn_or_script () && cmd.line () >= line) + take_action (cmd); } void @@ -336,19 +338,17 @@ void tree_breakpoint::visit_statement (tree_statement& stmt) { - if (stmt.line () >= line) - { - take_action (stmt); - } - else if (stmt.is_command ()) + if (stmt.is_command ()) { tree_command *cmd = stmt.command (); cmd->accept (*this); } - - // There is no need to do anything for expressions because they - // can't contain additional lists of statements. + else + { + if (stmt.line () >= line) + take_action (stmt); + } } void @@ -457,16 +457,16 @@ } else if (act == clear) { - tr.delete_breakpoint (); - found = true; + if (tr.is_breakpoint ()) + { + tr.delete_breakpoint (); + found = true; + } } else if (act == list) { if (tr.is_breakpoint ()) - { - bp_list.append (octave_value (tr.line ())); - line = tr.line () + 1; - } + bp_list.append (octave_value (tr.line ())); } else panic_impossible (); @@ -485,16 +485,16 @@ } else if (act == clear) { - stmt.delete_breakpoint (); - found = true; + if (stmt.is_breakpoint ()) + { + stmt.delete_breakpoint (); + found = true; + } } else if (act == list) { if (stmt.is_breakpoint ()) - { - bp_list.append (octave_value (lineno)); - line = lineno + 1; - } + bp_list.append (octave_value (lineno)); } else panic_impossible ();