[Pydev-cvs] org.python.pydev.debug/pysrc pydevd.py,1.2,1.3
Brought to you by:
fabioz
From: Aleksandar T. <at...@us...> - 2004-04-28 02:49:57
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6529/pysrc Modified Files: pydevd.py Log Message: Stepping is done Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pydevd.py 27 Apr 2004 19:13:20 -0000 1.2 --- pydevd.py 28 Apr 2004 02:49:48 -0000 1.3 *************** *** 162,166 **** def makeMessage(self, cmd, seq, payload): ! encoded = urllib.quote(str(payload), '/<>_=" ') return str(cmd) + '\t' + str(seq) + '\t' + encoded + "\n" --- 162,166 ---- def makeMessage(self, cmd, seq, payload): ! encoded = urllib.quote(str(payload), '/<>_=" \t') return str(cmd) + '\t' + str(seq) + '\t' + encoded + "\n" *************** *** 272,278 **** try: int_id = int(thread_id) ! print >>sys.stderr, "enumerating" threads = threading.enumerate() ! print >>sys.stderr, "done enumerating" for i in threads: if int_id == id(i): return i --- 272,279 ---- try: int_id = int(thread_id) ! # print >>sys.stderr, "enumerating" ! # there was a deadlock here when I did not remove the tracing function when thread was dead threads = threading.enumerate() ! # print >>sys.stderr, "done enumerating" for i in threads: if int_id == id(i): return i *************** *** 390,394 **** try: cmd = None ! print >>sys.stderr, "processing command", id if (id == CMD_VERSION): # response is version number cmd = self.cmdFactory.makeVersionMessage(seq) --- 391,395 ---- try: cmd = None ! # print >>sys.stderr, "processing command", id if (id == CMD_VERSION): # response is version number cmd = self.cmdFactory.makeVersionMessage(seq) *************** *** 437,441 **** thread.stop_reason = stop_reason ! def doWaitSuspend(self, thread): """ busy waits until the thread state changes to RUN it expects thread's state as attributes of the thread. --- 438,442 ---- thread.stop_reason = stop_reason ! def doWaitSuspend(self, thread, frame, event, arg): """ busy waits until the thread state changes to RUN it expects thread's state as attributes of the thread. *************** *** 444,448 **** # print >>sys.stderr, "thread suspended", thread.getName() ! cmd = self.cmdFactory.makeThreadSuspendMessage(id(thread), thread.pydev_frame, thread.stop_reason) self.writer.addCommand(cmd) while (thread.pydev_state == PyDB.STATE_SUSPEND): --- 445,449 ---- # print >>sys.stderr, "thread suspended", thread.getName() ! cmd = self.cmdFactory.makeThreadSuspendMessage(id(thread), frame, thread.stop_reason) self.writer.addCommand(cmd) while (thread.pydev_state == PyDB.STATE_SUSPEND): *************** *** 453,469 **** """ process any stepping instructions """ if (thread.pydev_step_cmd == CMD_STEP_INTO): ! thread.pydev_step_return = None ! pass elif (thread.pydev_step_cmd == CMD_STEP_OVER): ! thread.pydev_step_stop = thread.pydev_frame elif (thread.pydev_step_cmd == CMD_STEP_RETURN): ! thread.pydev_step_stop = thread.pydev_frame.f_back except AttributeError: thread.pydev_step_cmd = None # so we do ont thro pass ! del thread.pydev_frame ! del thread.pydev_event ! del thread.pydev_arg ! print >>sys.stderr, "thread resumed", thread.getName() cmd = self.cmdFactory.makeThreadRunMessage(id(thread), thread.pydev_step_cmd) --- 454,466 ---- """ process any stepping instructions """ if (thread.pydev_step_cmd == CMD_STEP_INTO): ! thread.pydev_step_stop = None elif (thread.pydev_step_cmd == CMD_STEP_OVER): ! thread.pydev_step_stop = frame elif (thread.pydev_step_cmd == CMD_STEP_RETURN): ! thread.pydev_step_stop = frame.f_back except AttributeError: thread.pydev_step_cmd = None # so we do ont thro pass ! print >>sys.stderr, "thread resumed", thread.getName() cmd = self.cmdFactory.makeThreadRunMessage(id(thread), thread.pydev_step_cmd) *************** *** 484,492 **** """ if thread has a suspend flag, we suspend with a busy wait """ if (t.pydev_state == PyDB.STATE_SUSPEND): - t.pydev_frame = frame - t.pydev_event = event - t.pydev_arg = arg wasSuspended = True ! self.doWaitSuspend(t) return self.trace_dispatch except AttributeError: --- 481,486 ---- """ if thread has a suspend flag, we suspend with a busy wait """ if (t.pydev_state == PyDB.STATE_SUSPEND): wasSuspended = True ! self.doWaitSuspend(t, frame, event, arg) return self.trace_dispatch except AttributeError: *************** *** 498,510 **** if ( not wasSuspended and event == 'line'): ! """ step handling """ try: if (t.pydev_step_cmd == CMD_STEP_INTO): self.setSuspend(t, CMD_STEP_INTO) ! self.doWaitSuspend(t) elif (t.pydev_step_cmd == CMD_STEP_OVER or t.pydev_step_cmd == CMD_STEP_RETURN): if (t.pydev_step_stop == frame): self.setSuspend(t, t.pydev_step_cmd) ! self.doWaitSuspend(t) except: t.pydev_step_cmd = None --- 492,504 ---- if ( not wasSuspended and event == 'line'): ! """ step handling. We stop when we hit the right frame""" try: if (t.pydev_step_cmd == CMD_STEP_INTO): self.setSuspend(t, CMD_STEP_INTO) ! self.doWaitSuspend(t, frame, event, arg) elif (t.pydev_step_cmd == CMD_STEP_OVER or t.pydev_step_cmd == CMD_STEP_RETURN): if (t.pydev_step_stop == frame): self.setSuspend(t, t.pydev_step_cmd) ! self.doWaitSuspend(t, frame, event, arg) except: t.pydev_step_cmd = None |