# HG changeset patch # User John W. Eaton # Date 1280440190 14400 # Node ID e5c7522319858e8122d519fa1b84179b072b17de # Parent 1b2fcd122c6aa9143e6448065632cf05eca86863 delete set/delete breakpoint functions from tree_if_command and tree_switch_command classes diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-07-29 John W. Eaton + + * pt-bp.cc (tree_breakpoint::visit_if_command): Also allow + breakpoint to be set on command, same as for switch, while, or + do-until statments. + * pt-select.h, pt-select.cc (tree_if_command::set_breakpoint, + tree_if_command::delete_breakpoint, tree_switch_command::set_breakpoint, + tree_switch_command::delete_breakpoint): Delete functions and decls. + (bug #30490). + 2010-07-29 Jaroslav Hajek * ov.cc (octave_value::subsref (..., const std::list *) diff --git a/src/pt-bp.cc b/src/pt-bp.cc --- a/src/pt-bp.cc +++ b/src/pt-bp.cc @@ -214,10 +214,16 @@ void tree_breakpoint::visit_if_command (tree_if_command& cmd) { - tree_if_command_list *lst = cmd.cmd_list (); + if (cmd.line () >= line) + take_action (cmd); - if (lst) - lst->accept (*this); + if (! found) + { + tree_if_command_list *lst = cmd.cmd_list (); + + if (lst) + lst->accept (*this); + } } void diff --git a/src/pt-select.cc b/src/pt-select.cc --- a/src/pt-select.cc +++ b/src/pt-select.cc @@ -93,30 +93,6 @@ delete trail_comm; } -void -tree_if_command::set_breakpoint (void) -{ - if (list) - { - tree_if_clause *elt = list->front (); - - if (elt) - elt->set_breakpoint (); - } -} - -void -tree_if_command::delete_breakpoint (void) -{ - if (list) - { - tree_if_clause *elt = list->front (); - - if (elt) - elt->set_breakpoint (); - } -} - tree_command * tree_if_command::dup (symbol_table::scope_id scope, symbol_table::context_id context) const @@ -230,30 +206,6 @@ delete trail_comm; } -void -tree_switch_command::set_breakpoint (void) -{ - if (list) - { - tree_switch_case *elt = list->front (); - - if (elt) - elt->set_breakpoint (); - } -} - -void -tree_switch_command::delete_breakpoint (void) -{ - if (list) - { - tree_switch_case *elt = list->front (); - - if (elt) - elt->set_breakpoint (); - } -} - tree_command * tree_switch_command::dup (symbol_table::scope_id scope, symbol_table::context_id context) const diff --git a/src/pt-select.h b/src/pt-select.h --- a/src/pt-select.h +++ b/src/pt-select.h @@ -133,10 +133,6 @@ ~tree_if_command (void); - void set_breakpoint (void); - - void delete_breakpoint (void); - tree_if_command_list *cmd_list (void) { return list; } octave_comment_list *leading_comment (void) { return lead_comm; } @@ -270,10 +266,6 @@ ~tree_switch_command (void); - void set_breakpoint (void); - - void delete_breakpoint (void); - tree_expression *switch_value (void) { return expr; } tree_switch_case_list *case_list (void) { return list; }