Package: pdbx
PDBXWhat is it----------pdbx: A remote pdb debugger Base on pdbIt's:1) be compatible with pdb2) remote debug supported3) xq/xquit commands supportedquit safely from debugger, the program being executed is continued(not abored)4) redebug supported5) suspend mode supported6) pystack(like jstack) supportedInstalling pdbx---------------1) Download pdbx from https://code.google.com/p/stonelab/downloads/list or https://pypi.python.org/pypi2) Unpack the archivetar xvf pdbx-x.x.x.tar.gz3) Install pdbxsudo python setup.py installHow to use pdbx---------------1) Add pbdx in python scriptse.g.from pdbx import Rpdbrpdb = Rpdb()                # Debugger started. Port is 8787(Default Value),   Suspend is True(Default Value)rpdb = Rpdb(9898)            # Debugger started. Port is 9898(Specified Value), Suspend is True(Default Value)rpdb = Rpdb(suspend=False)   # Debugger started. Port is 8787(Default Value),   Suspend is False(Specified Value)rpdb = Rpdb(9898, False)     # Debugger started. Port is 9898(Specified Value), Suspend is False(Specified Value)rpdb.set_trace()2) Remote debug with telnete.g.telnet xxx.xxx.xxx.xxx 87873) Interact with pdb commandsDocumented commands (type help <topic>):========================================EOF    bt         cont      enable  jump  pp       run      unt     xqa      c          continue  exit    l     q        s        until   xquitalias  cl         d         h       list  quit     step     upargs   clear      debug     help    n     r        tbreak   wb      commands   disable   ignore  next  restart  u        whatisbreak  condition  down      j       p     return   unalias  wherexq/xquit are new commands in pdbxit's used to quit safely from debugger, the program being executed is continued(not abored)4) Re-Remote debug with telnettelnet again.5) use pystackenable pystack in python scripts and then run the scriptse.g.import pdbxpdbx.enable_pystack()use kill -30 pid, then scripts will print python thread stack info:"CP Server Thread-4" tid=4369723392at self.__bootstrap_inner()(threading.py:525)at self.run()(threading.py:552)at conn = self.server.requests.get()(__init__.py:1367)at self.not_empty.wait()(Queue.py:168)at waiter.acquire()(threading.py:244)"CP Server Thread-7" tid=4382343168at self.__bootstrap_inner()(threading.py:525)at self.run()(threading.py:552)at conn = self.server.requests.get()(__init__.py:1367)at self.not_empty.wait()(Queue.py:168)at waiter.acquire()(threading.py:244)"MainThread" tid=140735286018432at app.run()(raspctl.py:173)at return wsgi.runwsgi(self.wsgifunc(*middleware))(application.py:313)at return httpserver.runsimple(func, validip(listget(sys.argv, 1, '')))(wsgi.py:54)at server.start()(httpserver.py:157)at self.tick()(__init__.py:1765)at s, addr = self.socket.accept()(__init__.py:1800)at sock, addr = self._sock.accept()(socket.py:202)at pystack()(pdbx.py:179)at for filename, lineno, _, line in traceback.extract_stack(stack):(pdbx.py:168)Release Notes-------------V0.1.01) remote debug supportedV0.2.01) xq/xquit supported2) redebug supported3) suspend mode supported4) add setup.pyv0.3.01) pystack supportedAuthor Info-----------author: stone2083<Stone.J>email:  stone2083@yahoo.cnblog:   http://www.blogjava.net/stone2083site:   https://code.google.com/p/stonelab