changeset 16368:48fe490fd633

set breakpoint on if command list, not if command itself * pt-bp.cc (tree_breakpoint::visit_if_command): Only process list; don't set breakpoint on if command itself.
author John W. Eaton <jwe@octave.org>
date Mon, 25 Mar 2013 18:54:11 -0400
parents 6964e6b92fc1
children 29e03b0e7e8d
files libinterp/parse-tree/pt-bp.cc
diffstat 1 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-bp.cc	Mon Mar 25 14:32:49 2013 -0700
+++ b/libinterp/parse-tree/pt-bp.cc	Mon Mar 25 18:54:11 2013 -0400
@@ -214,16 +214,10 @@
 void
 tree_breakpoint::visit_if_command (tree_if_command& cmd)
 {
-  if (cmd.line () >= line)
-    take_action (cmd);
+  tree_if_command_list *lst = cmd.cmd_list ();
 
-  if (! found)
-    {
-      tree_if_command_list *lst = cmd.cmd_list ();
-
-      if (lst)
-        lst->accept (*this);
-    }
+  if (lst)
+    lst->accept (*this);
 }
 
 void