veriy simple xdebug protocol implementation so that you can debug PHP easily with Vim
VimL
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
autoload
plugin
.gitignore
README
addon-info.json

README

No, this is no complete xdebug implementation and it will never be one.

This tries to be a quick and dirty hack to get some of my jobs done without
always firing up Eclipse

dependencies:
  - see vim-addon-xdebug-addon-info.txt
  - socat

http://url?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=12894211795611

HOWTO:
============
1) make sure vim-addon-async works (compile the c helper application)

2) :XDbgStart

3) open web page such as
  http://url?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=12894211795611

4) call g:xdebug.ctx.send('step_into')

  (Vim crashes soon :-( )
  It seems to crash less often when switching syn off! ??

  See plugin/xdebug.vim to see that Eclipse standard mappings have are used by
  default.

  XDbgStack works (current stack is feed to quickfix)

  Eg this prints the contents of $_GET
  call xdebug#Eval('$_GET')

5) watching vars:
  manually: call xdebug#Eval('$_GET')

  more convenient:
  XDbgVarView opens a buffer. Add lines like this:

    watch $_GET
    watch $_POST['foo']

  use :UpdateWatchView to update the buffer.
  This will be done automatically on stepping.

  You can visually select lines and press <cr> to execute arbitrary PHP code

6) breakpoints
  XDbgBreakPoints opens a window. You add breakpoints by adding lines (the way shown below the marker)
  then pressing enter. Some more porcelaine is missing!

  As alterntavie press F9 or use the XDbgToggleLineBreakpoint command

  :-) Most of the breakpoint types are not supported by xdebug?

  " Add to your .vimrc to enable breakpoint on first line.
  let g:xdebug = {'stop_on_first_line': 1}

7) xdebug port (defaults to 9000):
  Either call fun! xdebug#Start({'port':9001})
  or set it in your .vimrc:
  let g:xdebug.opts = { 'port' : 9001 }

TODO:
====
- Help me make this all more mature / complete
  * inspect vars (stack level!)
  * exec code
  * break points
  base64 encoding has been implemented in webapi-vim
- implement things like "goto cursor" (there is a temporary breakpoint command)
- ...

This is the protocol documentation I found:
- http://xdebug.org/docs-dbgp.php
- The messages sent by PDT (Eclipse) can be debugged easily.

Note
====
This plugin has enough features for everyday work now.
If you want more let me know.

Thanks TO
===========
mattn (github) who wrote the nice XML parsing library which also contains the
bas64 enc/decoding


Screeshot:
===========
see branch screenshots or visit this url:
http://mawercer.de/~marc/vim-xdebug-screenshot.png

related work
============
http://www.vim.org/scripts/script.php?script_id=4009
https://github.com/derickr/xdebug

Don't by shy and read this very accurate list about why PHP sucks:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/