Ejemplo n.º 1
0
 /**
  * called at run-time for each line
  * @param string the script name
  * @param int the current line
  * @param mixed the execution variables
  */
 public function step($scriptName, $line, $vars)
 {
     if ($this->ignoreInterrupt) {
         return;
     }
     // avoid spurious step calls from __destruct() method
     $this->ignoreInterrupt = true;
     if (PDB_DEBUG) {
         pdb_Logger::logDebug("step: {$scriptName} @ {$line}");
     }
     // pull the current frame from the stack or the top-level environment
     $this->session->currentFrame = isset($vars['__pdb_CurrentFrame']) ? $vars['__pdb_CurrentFrame'] : $this->session->currentTopLevelFrame;
     unset($vars['__pdb_CurrentFrame']);
     $this->session->currentFrame->update($line, $vars);
     if ($this->session->hasBreakpoint($scriptName, $line)) {
         $stepNext = $this->handleRequests();
         if (PDB_DEBUG) {
             pdb_Logger::logDebug("continue");
         }
         /* clear all dynamic breakpoints */
         foreach ($this->session->allFrames as $currentFrame) {
             $currentFrame->stepNext = false;
         }
         /* set new dynamic breakpoint */
         if ($stepNext != pdb_JSDebugger::GO) {
             $currentFrame = $this->session->currentFrame;
             /* break in current frame or frame below */
             if ($stepNext != pdb_JSDebugger::STEP_OUT) {
                 $currentFrame->stepNext = $stepNext;
             }
             /* or break in any parent */
             while ($currentFrame = $currentFrame->parent) {
                 $currentFrame->stepNext = $stepNext;
             }
         }
     }
     $this->ignoreInterrupt = false;
     if (PDB_DEBUG) {
         pdb_Logger::logDebug("endStep: {$scriptName} @ {$line}");
     }
 }