Permalink
Browse files

can haz temporary breakpoints!

  • Loading branch information...
1 parent e252145 commit e8917967b6727078922ff1e9624ec1ead4033ee8 @jaredly committed Jul 11, 2010
Showing with 15 additions and 2 deletions.
  1. +14 −1 vim_phpdebug/new_debugger.py
  2. +1 −1 vim_phpdebug/ui.py
@@ -169,6 +169,7 @@ def set_status(self, status):
cmd('o', 'over', help='step over next function call', lead='o')('step_over')
cmd('i', 'into', help='step into next function call', lead='i')('step_into')
cmd('out', help='step out of current function call', lead='t')('step_out')
+ cmd('r', 'run', help='continue execution until a breakpoint is reached or the program ends', lead='r')('run')
@cmd('e', 'eval', help='eval some code', plain=True)
def eval_(self, code):
@@ -203,6 +204,18 @@ def break_(self):
self.bend.command('breakpoint_set', 't', 'line', 'f', 'file://' + file, 'n', row, data='')
else:
self.bend.command('breakpoint_remove', 'd', bid)
+
+ @cmd('h', 'here', help='continue execution until the cursor (tmp breakpoint)', lead='h')
+ def here(self):
+ (row, col) = vim.current.window.cursor
+ file = os.path.abspath(vim.current.buffer.name)
+ if not os.path.exists(file):
+ print 'Not in a file'
+ return
+ tid = self.bend.cid + 1
+ # self.ui.queue_break(tid, file, row)
+ self.bend.command('breakpoint_set', 't', 'line', 'r', '1', 'f', 'file://' + file, 'n', row, data='')
+ self.bend.command('run')
def commands(self):
self._commands = self.cmd.bind(self)
@@ -255,7 +268,7 @@ def _init(self, node):
handle('step_into')(_change)
handle('step_out')(_change)
handle('step_over')(_change)
- handle('run')(_status)
+ handle('run')(_change)
def _log(self, node):
self.ui.windows['log'].write(node.toprettyxml(indent=' '))
View
@@ -124,7 +124,7 @@ def set_break(self, tid, bid):
self.breaks[bid] = file, line, tid
vim.command('sign place %d name=breakpt line=%d file=%s' % (tid, line, file))
else:
- print 'failed to set breakpoint... %d : %s' % (tid, self.waiting)
+ pass # print 'failed to set breakpoint... %d : %s' % (tid, self.waiting)
def clear_break(self, bid):
if bid in self.breaks:

0 comments on commit e891796

Please sign in to comment.