The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Vim::Debug::Daemon - Handle communication between a debugger and clients

VERSION

version 0.7

SYNOPSIS

   use Vim::Debug::Daemon;
   Vim::Debug::Daemon->run;

DESCRIPTION

This module implements a Vim::Debug daemon. The daemon manages communication between one or more clients and their debuggers. Clients will usually be an editor like Vim. A debugger is spawned for each client.

Internally this is implemented with POE and does non blocking reads for debugger output.

COMMUNICATION PROTOCOL

All messages passed between the client (vim) and the daemon (vdd) consist of a set of fields followed by an End Of Message string. Each field is seperated from the next by an End Of Record string.

All messages to the client have the following format:

    Debugger status
    End Of Record
    Line Number
    End Of Record
    File Name
    End Of Record
    Value
    End Of Record
    Debugger output
    End Of Message

All messages to the server have the following format:

    Action (eg step, next, break, ...)
    End Of Record
    Parameter 1
    End Of Record
    Parameter 2
    End Of Record
    ..
    Parameter n 
    End Of Message

After every message, the daemon also touches a file. Which is kind of crazy.

Connecting

When you connect to the Vim::Debug Daemon (vdd), it will send you a message that looks like this:

    $CONNECT . $EOR . $EOR . $EOR . $SESSION_ID . $EOR . $EOM 

You should respond with a message that looks like

    'create' . $EOR . $SESSION_ID . $EOR . $LANGUAGE $EOR $DBGR_COMMAND $EOM

Disconnecting

To disconnect send a 'quit' message.

    'quit' . $EOM

The server will respond with:

    $DISCONNECT . $EOR . $EOR . $EOR . $EOR . $EOM

And then exit.

POE STATE DIAGRAM

    ClientConnected
    
    ClientInput
        |                               __
        v                              v  |
       In -> Translate -> Write --> Read  |
                          |   ^     |  |  |
                          |   |_____|  |__|
                          |   
                          v
                         Out

AUTHOR

Eric Johnson <vimdebug at iijo dot org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Eric Johnson.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.