doulierong0334 2012-04-03 14:31 采纳率: 100%
浏览 102
已采纳

debug php使用vim和xdebug,时间设置

I use vim + xdebug to debug php. If the debug operation waste a long time, vim will lost the connection with xdebug, and I have to restart the debug by press <kbd>F5</kbd> and do it from the first step again. So how can I set a longer time for the debug procedure?

  • 写回答

2条回答 默认 最新

  • douwen1006 2012-04-04 17:07
    关注

    The 5 second timeout is hard-coded in debugger.py. You can increase it by modifying the following line:

      def accept(self):
        print 'waiting for a new connection on port '+str(self.port)+' for 5 seconds...'
        serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        try:
          serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          serv.bind(('', self.port))
    
          # Set a higher timeout here...
          serv.listen(5)
          (self.sock, address) = serv.accept()
        except socket.timeout:
          serv.close()
          self.stop()
          print 'timeout'
          return
    

    In my plugin version, that happens to be line 556 of debugger.py. If your differs, just search in Vim for 5 or second.

    Update:

    Also found it at line 666

      def __init__(self, port = 9000, max_children = '32', max_data = '1024', max_depth = '1', minibufexpl = '0', debug = 0):
        """ initialize Debugger """
    
        # Probably need to increase here too...
        socket.setdefaulttimeout(5)
        self.port       = port
        self.debug      = debug
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败