Devel-PDB
view release on metacpan or search on metacpan
lib/Devel/PDB.pm view on Meta::CPAN
-title => 'Source',
);
$sv = $sv_win->add(
'sv', 'Devel::PDB::SourceView',
-border => 1,
#-padbottom => 3,
window_style(),
);
$lower_win = $cui->add(
'lower_win', 'Window',
-border => 0,
-y => -1,
-height => $lower_height,
window_style(),
);
$auto_win = $lower_win->add(
'auto_win', 'Window',
-border => 1,
-y => -1,
-width => $half_width,
-title => 'Auto',
window_style(),
);
$padvar_list = $auto_win->add(
'padvar_list', 'Devel::PDB::NamedListbox',
-readonly => 1,
-sort_key => 'name',
-named_list => \@padlist_disp,
);
$padvar_list->userdata($cui);
$watch_win = $lower_win->add(
'watch_win', 'Window',
-border => 1,
-x => -1,
-y => -1,
-padleft => $half_width,
-title => 'Watch',
window_style(),
);
$watch_list = $watch_win->add(
'watch_list', 'Devel::PDB::NamedListbox',
# -sort_key => 'name', # For sorting by name
-named_list => \@watch_exprs,
);
my $fConfig = config_file("conf");
my @aFile = ();
my @aEdit = ();
my @aView = ();
my @aExecution = ();
my @aBreakpoint = ();
my @aSettings = ();
set_key_binding(\&ui_db_help, "Keys", "Keys help", "\cK");
set_key_binding(sub { shift->getobj('menu')->focus }, "Menu", "Main menu", KEY_F(10));
# Submenu - File
push(@aFile, set_key_binding(sub { db_view_std_files(0); $sv_win->focus; }, "ViewSTDFiles", "View STD* files", KEY_F(4)));
push(
@aFile,
set_key_binding(
sub {
if ($ui_window_focused == 2) {
$update_watch_list = 1;
return;
}
my $ret = $cui->dialog(
-title => 'Restarting program',
-buttons => [{
-label => '< Save config first >',
-value => 1,
-shortcut => 's'
},
{ -label => '< Restart only >',
-value => 2,
-shortcut => 'r'
},
{ -label => '< Exit - Return >',
-value => 0,
-shortcut => 'x'
},
],
-message => 'Choose option to restarting program',
window_style(),
);
if ($ret) {
save_state_file($fConfig) if ($ret == 1);
$db_exit = 1;
DoRestart();
}
},
"Restart",
"Restart program",
"\cR"
));
push(
@aFile,
set_key_binding(
sub {
my $filename = $cui->filebrowser(
-title => "Find and load Perl module from file ",
-mask => [['\.p[lm]$', 'Perl modules']],
DB::window_style(),
);
if ($filename) {
if (!exists($main::{"_<$filename"})) {
# Delete dir from modules in actuall directory
my $dir = getcwd();
if ($dir) {
$dir .= "/";
$filename =~ s/$dir//;
}
lib/Devel/PDB.pm view on Meta::CPAN
"ConfigLoad",
"Load config file",
"\cL"
));
push(
@aSettings,
set_key_binding(
sub {
save_state_file($fConfig)
if $cui->dialog(
-title => 'Save config file',
-buttons => ['yes', 'no'],
-message => 'Do you really want save config?',
window_style(),
);
},
"ConfigSave",
"Save config file",
"\cS"
));
# Submenu - View
push(
@aView,
set_key_binding(
sub {
my $text;
local $Data::Dumper::Purity = 0;
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Indent = 2;
local $Data::Dumper::Sortkeys = 1;
$text = (scalar(@Devel::PDB::script_args) ? Dumper(@Devel::PDB::script_args) : "Not arguments putted");
dialog_message(
-title => "Arguments",
-message => $text
);
},
"Arguments",
"View program parameters",
"\cA"
));
push(@aView, set_key_binding(sub { set_active_window(1) }, "WindowSource", "Switch to the Source Code Window", KEY_F(1)));
push(@aView,
set_key_binding(sub { set_active_window(2) }, "WindowLexical", "Switch to the Lexical Variable Window", KEY_F(2)));
push(@aView, set_key_binding(sub { set_active_window(3) }, "WindowWatches", "Switch to the Watch Window", KEY_F(3)));
push(@aView, set_key_binding(sub { ui_view_stack(0) }, "WindowStack", "View Stack Window", "\cT"));
push(@aView, set_key_binding(sub { ui_text_editor(3) }, "ViewVariables", "View special variables", "\cU"));
push(@aView,
set_key_binding(sub { ui_adjust_vert_parts(1) }, "VerticalPartsMin", "Vertical window(Source file) minimize", '{'));
push(@aView,
set_key_binding(sub { ui_adjust_vert_parts(-1) }, "VerticalPartsMax", "Vertical window(Source file) maximize", '}'));
push(@aView,
set_key_binding(sub { ui_adjust_hori_parts(-1) }, "HorizontalPartsMin", "Horizontal window(Stack) minimize", '['));
push(@aView,
set_key_binding(sub { ui_adjust_hori_parts(1) }, "HorizontalPartsMin", "Horizontal window(Stack) maximize", ']'));
$cui->add(
'menu',
'Menubar',
-menu => [{
-label => 'File',
-submenu => \@aFile,
},
{ -label => 'View',
-submenu => \@aView,
},
{ -label => 'Execution',
-submenu => \@aExecution,
},
{ -label => 'Breakpoint',
-submenu => \@aBreakpoint,
},
{ -label => 'Settings',
-submenu => \@aSettings,
},
{ -label => 'Help',
-submenu => [{
-label => 'Keys',
-value => \&ui_db_help,
},
{ -label => 'About',
-value => sub {
dialog_message(
-title => "About",
-message => <<EOF
Devel::PDB - A simple Curses-based Perl DeBugger in version $VERSION
PerlDeBugger is a Curses-based Perl debugger with most of the essential functions such as monitoring windows for paddlist,
call stack, custom watch expressions, etc.
Suitable for debugging or tracing complicated Perl applications on the spot.
AUTHORS
Ivan Yat-Cheung Wong
Igor Bujna
MODULES
Curses - $Curses::VERSION
Curses:UI - $Curses::UI::VERSION
EOF
,
DB::window_style(),
);
},
},
]
},
],
window_style(),
);
#open my $fd0, '>stdout';
#open my $fd1, '>stderr';
#open STDOUT, ">&$fd0";
#open STDERR, ">&$fd1";
#open STDOUT, ">stdout";
unlink config_file($_) foreach ('stderr', 'stdout');
open STDERR, ">>" . config_file("stderr");
lib/Devel/PDB.pm view on Meta::CPAN
show/open compiled files
=item *
Stack Trace Window
=item *
Immediate Window for executing arbitrary perl statement
=item *
Other functionalities
=back
=head2 KYES BINDING - standart key
=over
=item Global
=over
=item WindowSource - F1
Switch to the Source Code Window
=item WindowLexical - F2
Switch to the Lexical Variable Window
=item WindowWatches - F3
Switch to the Watch Window
=item ViewSTDFile - F4
Views STDOUT or STDERR file
=item Continue - F5
Continue execution
=item StepOut - F6
Step Out
=item StepIn - F7
Step In
=item SteOver - F8
Step Over
=item Breakpoint - F9
Toggle Breakpoint. Set or remove breakpoint on cursor position.
=item Menu - F10
Open main - top menu
=item FilesCompiled - F11
Show 'I<Compiled Files>' Dialog
=item FilesOpened - F12
Show 'I<Opened Files>' Dialog
=item Quit - Ctrl+Q, Ctrl+C
Quit the debugger
=item BreakpointCode - Ctrl+O
Add/Edit/Remove breakpoint with condition on given line. Can be also removed by F9 - Breakpoint
=item Refresh - Ctrl+N
Refresh all window contents
=item Export - Ctrl+Y
Export information to file from actual source and stack variables or watches
=item WatchExpression - Ctrl+W
Add watch expression
=item Restart - Ctrl+R
Restart program
=item RunCommand - Ctrl+P
Add commands to runned perl script
=item Arguments - Ctrl+A
View arguments(parameters) of runned program
=item ArgumentsEdit - Ctrl+E
Edit arguments(parameters) of runned program
=item EnviromentsEdit - Ctrl+M
Edit enviroments
=item Filebrowser - Ctrl+F
Find Perl module and load this module
=item WindowStack - Ctrl+T
View stack of runned program
=item ConfigSave - Ctrl+S
lib/Devel/PDB.pm view on Meta::CPAN
=item Lexical Variable Window / Watch Window
=over
=item UP/DOWN
Move the cursor
=item ENTER
Show the Data::Dumper output of the highlighted item in a scrollable dialog
=item DEL
Remove the highlighted expression (Watch Window only)
=back
=item Compiled File Dialog / Opened File Dialog
=over
=item TAB
Toggle the focus between the file list and the filter
=item ENTER
Select the highlighted file or apply the filter to the file list
=item F6, Ctrl+S, Ctrl+L
Export everything from window to given file
=back
=back
=head2 Config files
Files will be created in directory when program is run .
If in enviroment exist C<PDB_use_HOME> than everything is created into ~/.PDB directory.
Every file begin with program name and continue with:
=over
=item -conf
Configuration files of saved brakpoints and watches
=item -[stdout|stderr]
Output standart STD files from runned program
=item ~/.PDB.keys
Configuration files of rebinded keys.
For function keys is FX and for Cotrol keys is Control-X.
For example keys 'F10' for open Menu and keys 'Ctrl+C','Ctrl+Q','Q' for Quit.
Menu=F10
Quit=Control-C,Control-Q,Q
=item ~/.PDB.colours
Configuration of own colours as defined in Curses::UI::Color.
Each line has one definition, where frst is key and second is colour with space separattor.
For example set general foreground and background color as RED on WHITE:
-fg red
-bg white
=back
=head1 SEE ALSO
L<perldebug>
=head1 AUTHORS
Ivan Yat-Cheung Wong E<lt>email (at) ivanwong.infoE<gt>
Igor Bujna E<lt>igor.bujna (at) post.czE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2007 by Ivan Y.C. Wong, Igor Bujna
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
=cut
( run in 1.289 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )