Vim::Debug - Perl wrapper around a command line debugger
version 0.7
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->lineNumber; print $debugger->fileName; print $debugger->output; $debugger->write('q'); # quit
The Vim::Debug project integrates the Perl debugger with Vim, allowing developers to visually step through their code and examine variables.
Please note that this code is in beta and these libraries will be changing radically in the near future.
Vim compiled with +signs and +perl.
Replace $VIMHOME with your vim configuration directory. (/home/username/.vim on unix.)
TODO
git clone git@github.com:kablamo/VimDebug.git cd VimDebug perl Makefile.PL make sudo make install cp -r vim/* $VIMHOME/
The Vim::Debug class provides an object oriented wrapper around the Perl command line debugger.
Note that the read() method is non blocking.
Starts up the command line debugger in a seperate process.
start() always returns undef.
Write $command to the debugger's stdin. This method blocks until the debugger process reads. Be ssure to include a newline.
write() always returns undef;
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: lineNumber(), fileName(), value(), and out().
read() will also send an interrupt (CTL+C) to the debugger process if the stop() attribute is set to true.
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.
If $number parameter is used, the lineNumber class attribute is set using that value. If no parameters are passed, the current value of the lineNumber attribute is returned.
If $path parameter is used, the filePath class attribute is set using that value. If no parameters are passed, the current value of the filePath attribute is returned.
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.
Devel::ebug, perldebguts
Eric Johnson, cpan at iijo : :dot: : org
Copyright (C) 2003 - 3090, Eric Johnson
This module is GPL.
Eric Johnson <vimdebug at iijo dot org>
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.
To install Vim::Debug, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Vim::Debug
CPAN shell
perl -MCPAN -e shell install Vim::Debug
For more information on module installation, please visit the detailed CPAN module installation guide.