NAME
Vim::Debug - Perl wrapper around a command line debugger
VERSION
version 0.001
SYNOPSIS
If you are new to the Vim::Debug project please read the Vim::Debug::Manual first.
package Vim::Debug;
my $debugger = Vim::Debug->new;
$debugger->start;
$debugger->write('s'); # step
sleep(1) until $debugger->read;
print $debugger->line;
print $debugger->file;
print $debugger->output;
$debugger->write('q'); # quit
DESCRIPTION
The Vim::Debug project integrates the Perl debugger with Vim, allowing developers to visually step through their code and examine variables.
If you are new to the Vim::Debug project please read the Vim::Debug::Manual first.
Please note that this code is in beta and these libraries will be changing radically in the near future.
PREREQUISITES
Vim compiled with +signs and +perl.
INSTALL INSTRUCTIONS
Replace $VIMHOME with your vim configuration directory. (/home/username/.vim on unix.)
With cpanm
TODO
With github
git clone git@github.com:kablamo/VimDebug.git
cd VimDebug
perl Makefile.PL
make
sudo make install
cp -r vim/* $VIMHOME/
Vim::Debug
The Vim::Debug class provides an object oriented wrapper around the Perl command line debugger.
Note that the read() method is non blocking.
FUNCTIONS
start()
Starts up the command line debugger in a seperate process.
start() always returns undef.
write($command)
Write $command to the debugger's stdin. This method blocks until the debugger process reads. Be sure to include a newline.
write() always returns undef;
read()
Performs a nonblocking read on stdout from the debugger process. read() first looks for a debugger prompt.
If one is not found, the debugger isn't finished thinking so read() returns 0.
If a debugger prompt is found, the output is parsed. The following information is parsed out and saved into attributes: line(), file(), value(), and out().
read() will also send an interrupt (CTL+C) to the debugger process if the stop() attribute is set to true.
out($out)
If called with a parameter, out() removes ornaments (like <CTL-M> or irrelevant error messages or whatever) from text and saves the value.
If called without a parameter, out() returns the saved value.
translate($in)
Translate a protocol command ($in) to a native debugger command. The native debugger command is returned as an arrayref of strings.
Dies if no translation is found.
line($number)
If $number parameter is used, the line class attribute is set using that value. If no parameters are passed, the current value of the line attribute is returned.
file($path)
If $path parameter is used, the file class attribute is set using that value. If no parameters are passed, the current value of the file attribute is returned.
dbgrPromptRegex($regex)
If $regex parameter is used, the dbgrPromptRegex class attribute is set using that value. If no parameters are passed, the current value of the dbgrPromptRegex attribute is returned.
SEE ALSO
AUTHOR
Eric Johnson, cpan at iijo : :dot: : org
COPYRIGHT
Copyright (C) 2003 - 3090, Eric Johnson
This module is GPL.
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.