Sepia
view release on metacpan or search on metacpan
* lib/Sepia.pm (repl_strict): add 'strict mode' (thanks to
Lexical::Persistence) for those who swing that way (I don't),
inspired by Devel::REPL.
(repl_wantarray): Fix logic.
2007-04-25 Sean O'Rourke <sorourke@cs.ucsd.edu>
* VERSION: 0.70
* README: add license.
* Makefile.PL: remove dependency on Sub::Uplevel, make PadWalker
optional.
* lib/Sepia.pm (who): add optional regex filter.
(debug_inspect): fix non-scalar printing.
* sepia.el (sepia-dwim): fix staleness; change to find
documentation for modules.
(sepia-find-module-file): new function to try sepia- and xref-
module file-finding functions.
(sepia-next): use it.
(sepia-filter-by-module,sepia-filter-by-all): remove.
(sepia-keymap): use `sepia-dwim' for M-.
files (RT #25490).
2007-03-15 Sean O'Rourke <sorourke@cs.ucsd.edu>
* VERSION: 0.67
* sepia-ido.el: clean up bitrot.
* lib/Sepia.pm (apropos): don't create new stashes during
completion.
* sepia.el (sepia-show-locations): bind inhibit-read-only; filter
out mysterious NILs.
* Makefile.PL: require PadWalker 1.0 (RT #25463)
2007-03-13 Sean O'Rourke <sorourke@cs.ucsd.edu>
* VERSION: 0.66
* README (TODO): user-defined REPL abbrevs.
* lib/Sepia.pm (print_*): optional printing via YAML and
Data::Dump (from Shell::Perl).
(repl_wantarray): change eval context (same).
(repl_format): set formatter (same).
* Sepia.pm (tolisp): undef -> nil
* sepia.el (sepia-eval-raw): guess package.
* sepia.el (sepia-init): don't pop-to-buffer with prefix argument.
* sepia.el (sepia-beginning-of-defun,sepia-end-of-defun): avoid
recursion.
* sepia.el (sepia-buffer-package): look backward from point
instead of forward from point-min.
2006-05-24 Sean O'Rourke <sorourke@cs.ucsd.edu>
* Makefile.PL: added missing dependencies on PadWalker,
Sub::Uplevel.
* Sepia.pm: improved ",command"
* sepia-w3m.el (sepia-w3m-perldoc-this): simplify.
* sepia.el (perl-*): rename to sepia-*.
* sepia.el: reorg and cleanup.
* VERSION: 0.63
2006-05-19 Sean O'Rourke <sorourke@cs.ucsd.edu>
* sepia.el: fixed eldoc support. This only works with CVS Emacs,
Makefile.PL view on Meta::CPAN
'lisp=s' => \$SITE_LISP,
'info=s' => \$INFO_DIR,
'help' => \$HELP,
);
exit pod2usage( '-verbose' => 1 ) if $HELP;
test_for 'Devel::Peek', 'Printing internals requires Devel::Peek';
test_for 'Devel::Size', 'Printing variable sizes requires Devel::Size';
test_for 'IO::Scalar', 'Printing internals requires IO::Scalar because Devel::Peek sucks';
test_for 'PadWalker', 'Strict mode requires PadWalker';
test_for 'Devel::LexAlias', 'Strict mode requires Devel::LexAlias';
test_for 'LWP::Simple', 'CPAN documentation browsing requires LWP::Simple';
test_for 'Module::CoreList', 'sepia-core-version requires Module::CoreList';
test_for 'Module::Info', 'Required for some Emacs functions';
test_for 'BSD::Resource', 'Detailed command timing';
test_for 'Time::HiRes', 'Basic command timing';
# test_for 'Pod::Webserver', 'Pod::Webserver creates nice documentation.';
# test_for 'Scope::Upper', 'Required for return-from-context';
$INSTALL_INFO = 'install-info';
<p><a name="Debugger"></a>
<h3 class="section">3.2 Debugger</h3>
<p>Sepia uses Perl's debugger hooks and GUD mode to support conditional
breakpoints and single-stepping, and overrides Perl's <code>die()</code> to
invoke the debugger rather than unwind the stack. This makes it
possible to produce a backtrace, inspect and modify global variables,
and even continue execution when a program tries to kill itself. If the
PadWalker module is available, Sepia also provides functions to inspect
and modify lexical variables.
<p>The debugger has its own set of shortcuts, also prefixed by a comma.
<dl>
<dt><kbd>backtrace</kbd><dd>Show a backtrace.
<br><dt><kbd>delete</kbd><dd>Delete the current breakpoint.
<br><dt><kbd>down </kbd><var>n</var><dt><kbd>up </kbd><var>n</var><dd>Move the current stack frame up or down by <var>n</var> (or one) frames.
lib/Sepia.pm view on Meta::CPAN
=item C<@res = lexical_completions $type, $str, $sub>
Find lexicals of C<$sub> (or a parent lexical environment) of type
C<$type> matching C<$str>.
=cut
sub lexical_completions
{
eval q{ use PadWalker 'peek_sub' };
# "internal" function, so don't warn on failure
return if $@;
*lexical_completions = sub {
my ($type, $str, $sub) = @_;
$sub = "$PACKAGE\::$sub" unless $sub =~ /::/;
# warn "Completing $str of type $type in $sub\n";
no strict;
return unless defined *{$sub}{CODE};
my $pad = peek_sub(\&$sub);
if ($type) {
lib/Sepia.pm view on Meta::CPAN
define_shortcut freload => \&Sepia::repl_full_reload,
'freload MODULE', 'Reload MODULE and all its dependencies.';
define_shortcut time => \&Sepia::repl_time,
'time [0|1]', 'Print timing information for each command.';
define_shortcut lsmod => \&Sepia::repl_lsmod,
'lsmod [PATTERN]', 'List loaded modules matching PATTERN.';
}
=item C<repl_strict([$value])>
Toggle strict mode. Requires L<PadWalker> and L<Devel::LexAlias>.
=cut
sub repl_strict
{
eval q{ use PadWalker qw(peek_sub set_closed_over);
use Devel::LexAlias 'lexalias';
};
if ($@) {
print "Strict mode requires PadWalker and Devel::LexAlias.\n";
} else {
*repl_strict = sub {
my $x = as_boolean(shift, $STRICT);
if ($x && !$STRICT) {
$STRICT = {};
} elsif (!$x) {
undef $STRICT;
}
};
goto &repl_strict;
lib/Sepia/Debug.pm view on Meta::CPAN
## 0x100 give evals informative names
## 0x200 give anon subs informative names
## 0x400 save source lines in %{"_<$filename"}
$^P = 0x01 | 0x02 | 0x10 | 0x100 | 0x200;
$STOPDIE = 1;
$STOPWARN = 0;
}
sub peek_my
{
eval q{ require PadWalker };
if ($@) {
+{ }
} else {
*peek_my = \&PadWalker::peek_my;
goto &peek_my;
}
}
# set debugging level
sub repl_debug
{
debug(@_);
}
File: sepia.info, Node: Debugger, Next: Evaluation, Prev: Shortcuts, Up: Interactive Perl
3.2 Debugger
============
Sepia uses Perl's debugger hooks and GUD mode to support conditional
breakpoints and single-stepping, and overrides Perl's `die()' to invoke
the debugger rather than unwind the stack. This makes it possible to
produce a backtrace, inspect and modify global variables, and even
continue execution when a program tries to kill itself. If the
PadWalker module is available, Sepia also provides functions to inspect
and modify lexical variables.
The debugger has its own set of shortcuts, also prefixed by a comma.
`backtrace'
Show a backtrace.
`delete'
Delete the current breakpoint.
@end table
@node Debugger, Evaluation, Shortcuts, Interactive Perl
@section Debugger
Sepia uses Perl's debugger hooks and GUD mode to support conditional
breakpoints and single-stepping, and overrides Perl's @code{die()} to
invoke the debugger rather than unwind the stack. This makes it
possible to produce a backtrace, inspect and modify global variables,
and even continue execution when a program tries to kill itself. If the
PadWalker module is available, Sepia also provides functions to inspect
and modify lexical variables.
The debugger has its own set of shortcuts, also prefixed by a comma.
@table @kbd
@item backtrace
Show a backtrace.
@item delete
Delete the current breakpoint.
t/03without.t view on Meta::CPAN
my $str;
$str .= "use Test::Without::Module '$_';" for qw{
Devel::Peek
Devel::Size
IO::Scalar
Lexical::Persistence
LWP::Simple
Module::CoreList
Module::Info
PadWalker
BSD::Resource
Time::HiRes
};
eval $str;
my $res = eval q{use Time::HiRes;1};
ok(!$res, "Test::Without::Module works.");
$res = eval "use Sepia;1";
ok($res && !$@, "loads without optional prereqs? ($res, $@)");
( run in 0.608 second using v1.01-cache-2.11-cpan-05444aca049 )