Author: julianalbo
Date: Wed Aug 20 15:51:19 2008
New Revision: 30408

Modified:
   trunk/src/debug.c

Log:
debugger 'next' command uses the debugger runloop

Modified: trunk/src/debug.c
==============================================================================
--- trunk/src/debug.c   (original)
+++ trunk/src/debug.c   Wed Aug 20 15:51:19 2008
@@ -896,6 +896,9 @@
 {
     unsigned long  n   = 1;
     PDB_t  * const pdb = interp->pdb;
+    Interp *debugee;
+
+    TRACEDEB_MSG("PDB_next");
 
     /* Init the program if it's not running */
     if (!(pdb->state & PDB_RUNNING))
@@ -909,6 +912,9 @@
     /* Erase the stopped flag */
     pdb->state &= ~PDB_STOPPED;
 
+    /* Testing use of the debugger runloop */
+    #if 0
+
     /* Execute */
     for (; n && pdb->cur_opcode; n--)
         DO_OP(pdb->cur_opcode, pdb->debugee);
@@ -923,6 +929,20 @@
      */
     if (!pdb->cur_opcode)
         (void)PDB_program_end(interp);
+    #endif
+
+    debugee     = pdb->debugee;
+
+    new_runloop_jump_point(debugee);
+    if (setjmp(debugee->current_runloop->resume)) {
+        Parrot_eprintf(interp, "Unhandled exception while tracing\n");
+        pdb->state |= PDB_STOPPED;
+        return;
+    }
+    pdb->tracing = n;
+    pdb->debugee->run_core = PARROT_DEBUGGER_CORE;
+
+    TRACEDEB_MSG("PDB_next finished");
 }
 
 /*

Reply via email to