diff src/pt-bp.h @ 8658:73c4516fae10

New evaluator and debugger derived from tree-walker class
author John W. Eaton <jwe@octave.org>
date Wed, 04 Feb 2009 00:47:53 -0500
parents 5640a70cbab1
children eb63fbe60fab
line wrap: on
line diff
--- a/src/pt-bp.h
+++ b/src/pt-bp.h
@@ -30,6 +30,7 @@
 #include "toplev.h"
 
 class tree;
+class tree_decl_command;
 
 class
 tree_breakpoint : public tree_walker
@@ -55,7 +56,9 @@
 
   void visit_continue_command (tree_continue_command&);
 
-  void visit_decl_command (tree_decl_command&);
+  void visit_global_command (tree_global_command&);
+
+  void visit_static_command (tree_static_command&);
 
   void visit_decl_elt (tree_decl_elt&);
 
@@ -135,7 +138,11 @@
 
  private:
 
-  void take_action (tree &tr);
+  void do_decl_command (tree_decl_command&);
+
+  void take_action (tree& tr);
+
+  void take_action (tree_statement& stmt);
 
   // Statement line number we are looking for.
   int line;
@@ -160,49 +167,6 @@
 // available breakpoint.
 extern bool octave_debug_on_interrupt_state;
 
-#define MAYBE_DO_BREAKPOINT \
-  do \
-    { \
-      octave_function *xfcn = octave_call_stack::current (); \
- \
-      if (octave_debug_on_interrupt_state \
-	  || (tree::break_next >= 0 \
-	      && (tree::break_function == 0 || tree::break_function == xfcn) \
-	      && (tree::last_break_function != xfcn || tree::last_line != line ())) \
-	  || is_breakpoint ()) \
-        { \
-	  if (!octave_debug_on_interrupt_state && tree::break_next > 0) \
-	    { \
-	      tree::break_next--; \
-	      if (tree::last_line > 0) \
-		tree::last_line = line(); \
-	    } \
-	  else \
-	    { \
-              octave_debug_on_interrupt_state = false; \
- \
-              tree::break_next = -1; \
- \
-              if (xfcn) \
-                octave_stdout << xfcn->name () << ": ";  \
- \
-              octave_stdout << "line " << line () << ", " \
-			    << "column " << column () \
-			    << std::endl; \
- \
-              tree_print_code tpc (octave_stdout); \
-              this->accept (tpc); \
- \
-              octave_stdout << std::endl; \
- \
-              tree::break_statement = this; \
- \
-              do_keyboard (); \
-	    } \
-        } \
-    } \
-  while (0)
-
 #endif
 
 /*