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
orsecond
.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
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报