XDebug CLI Client

Updated: Sun, Jul 27, 2008 - 7:21am

You may have noticed from some of my previous posts that I'm the kind of guy who likes to use the command-line, even when there's a perfectly good gui solution. In fact, I almost regard a gui-only solution as a non-solution to many problems.

And one rather shocking probelm that I haven't seen a non-gui solution for is this one: PHP Debugging.

Since PHP is the one of the hotter programming languages for web applications nowadays, I think we're long overdue to have a good debugger for it. It gets in the way an awful lot, to not have one.

Of course, the problem of PHP debugging is being looked into. Just not the way I like it. XDebug provides us with a remote-debugging protocol for PHP. The remote-debugging protocol has its own name - dbgp. The authors gave it a name in the hopes that other programming languages could also implement the same interface. Then, we could have one debugger that could work on any programming language. That's a pretty admirable goal, in my opinion.

The problem is that we don't yet have a good client for dbgp. By "good", I mean one that has a command-line that uses gnu readline.

Here's what we do have.

We have a dbgp plugin for eclipse. Of course, eclipse is a programmer's IDE. I prefer to use the older and much more mature programmer's IDE: Unix.

Closer to home is the dbgp plugin for vim. This is actually what I use at work, and I find its workings to be adequate.  There are things I don't like about it.  For one, that when I print out values to the screen, I want to see them in a format like that of var_dump or print_r.  Instead, I get a weird format that doesn't allow me to see keys and values at the same time, and also truncates output to some arbitrary length. Furthermore, it partitions my vim windows up all weird, making it impossible to copy/paste anything out of there.  Also, because it doesn't have the command-line metaphor, I can't easily repeat evaluations I've made or anything like that.  Finally, it doesn't seem to allow me to define watchpoints.  That's just my list of grievances off the top of my head.

Most of those could be fixed within the context of the vim plugin, but there's one thing that can't be fixed in there:  Aesthetics.  I want a command-line debugger like gdb or winpdb, for Python.

Well, I tell ya.  I started work on that a little while ago.  I started from the source code of the vim plugin, and I'm trying to use the functionality of that while providing a different, command-line, interface.   I'd like to modularize it enough that the two interfaces can coexist in the same file, but behave as a vim plugin if executed in vim context or a cli program otherwise.

If I do it this way, both sides can benefit from the development of each other.

I would make one change, though:  The original is MIT licenced.  I would like to re-licence it as GPL. That's either so that I can distribute it with gnu readline support, or just because I don't want to work in my spare time on software that some huge corporation can steal from me.

If you'd like to help, feel free to grab what I've got so far from my git repository.

Your rating: None Average: 5 (10 votes)

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
               _                    _   _ 
___ __ __ | |__ __ __ (_) (_)
/ __| \ \/ / | '_ \ \ \ /\ / / | | | |
\__ \ > < | | | | \ V V / | | | |
|___/ /_/\_\ |_| |_| \_/\_/ _/ | |_|
|__/
Enter the code depicted in ASCII art style.