hmm.. thanks for the interest atcroft. i think i made some progress. the key is i have to require the script i am trying to debug. and also i had to add a sub called showfile().
this stuff is not documented which is sad because it means i have to read the DB.pm source (ack gasp) and understand perl internals and i don't know perl internals and i am afraid of perl internals.
anyway this is still very pre beta beginning new, but this seems to work (yeah!):
#!/usr/bin/perl -w
package PerlDebugger;
use DB;
@ISA = qw( DB );
sub new {
my $type = shift;
my $self = {};
bless $self, $type;
}
sub startDebugger {
my $self = shift;
my $sourceCode = shift;
eval( "require \"$sourceCode\";" );
$self->register();
print ">>" . $self->loadfile( $sourceCode, 3 ) . "<<\n";
print ">>" . $self->ready() . "<<\n";
print "\n>>";
print $DB::filename;
print "<<\n";
}
sub showfile {
print "showfile\n";
}
sub quit {
my $self = shift;
$self->done();
}
package main;
use strict;
my $code = "perlbot.pl";
my $dbgr = PerlDebugger->new();
$dbgr->startDebugger( $code );
i take it you use vim, atcroft? if i ever actually finish this i'll post it up on vim.sf.net and probably some other places too.
thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.