Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various cleanups #3

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/trepanpl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Standalone routine to invoke a Perl program under the debugger. # Standalone routine to invoke a Perl program under the debugger.


# The usual boilerplate... # The usual boilerplate...
use strict; use warnings; use English; use strict;
use warnings;
use English qw( -no_match_vars );


use File::Basename; use File::Spec; use File::Basename; use File::Spec;


Expand Down
14 changes: 11 additions & 3 deletions lib/Devel/Trepan/BrkptMgr.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,18 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net> # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
use strict; use warnings; no warnings 'redefine';
use English; package Devel::Trepan::BrkptMgr;

use strict;
use warnings;
no warnings 'redefine';

use English qw( -no_match_vars );

# TODO : What is the meaning of this use lib? Can it be removed?
use lib '../..'; use lib '../..';

use Devel::Trepan::DB::Breakpoint; use Devel::Trepan::DB::Breakpoint;
package Devel::Trepan::BrkptMgr;


sub new($$) sub new($$)
{ {
Expand Down
21 changes: 13 additions & 8 deletions lib/Devel/Trepan/CmdProcessor.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,23 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org> # Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org>
package Devel::Trepan::CmdProcessor;

use strict;
use warnings;
no warnings 'redefine';

use feature ":5.10"; # Includes "state" feature. use feature ":5.10"; # Includes "state" feature.
use Exporter;
use feature 'switch'; use feature 'switch';
use warnings; use strict;
use English qw( -no_match_vars );

use Exporter;


# Showing eval results can be done using either data dump package. # Showing eval results can be done using either data dump package.
require Data::Dumper; require Data::Dumper::Perltidy; require Data::Dumper;
require Data::Dumper::Perltidy;


# TODO : Shouldn't this use lib be removed?
use lib '../..'; use lib '../..';
require Devel::Trepan::BrkptMgr; require Devel::Trepan::BrkptMgr;
require Devel::Trepan::DB::Display; require Devel::Trepan::DB::Display;
Expand All @@ -23,12 +33,7 @@ require Devel::Trepan::CmdProcessor::Load unless
defined $Devel::Trepan::CmdProcessor::Load_seen; defined $Devel::Trepan::CmdProcessor::Load_seen;
require Devel::Trepan::CmdProcessor::Running; require Devel::Trepan::CmdProcessor::Running;
require Devel::Trepan::CmdProcessor::Validate; require Devel::Trepan::CmdProcessor::Validate;
use strict;
use warnings;
no warnings 'redefine';


package Devel::Trepan::CmdProcessor;
use English;
use Devel::Trepan::Util qw(hash_merge uniq_abbrev); use Devel::Trepan::Util qw(hash_merge uniq_abbrev);


use vars qw(@EXPORT @ISA $eval_result); use vars qw(@EXPORT @ISA $eval_result);
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Action.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Action; package Devel::Trepan::CmdProcessor::Command::Action;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::Condition ; use if !defined @ISA, Devel::Trepan::Condition ;
use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Break.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use lib '../../../..';
# require_relative '../../app/condition' # require_relative '../../app/condition'


package Devel::Trepan::CmdProcessor::Command::Break; package Devel::Trepan::CmdProcessor::Command::Break;
use English; use English qw( -no_match_vars );
use if !defined @ISA, Devel::Trepan::CmdProcessor::Command; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command;
unless (defined(@ISA)) { unless (defined(@ISA)) {
eval "use constant ALIASES => qw(b);"; eval "use constant ALIASES => qw(b);";
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Condition.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Condition; package Devel::Trepan::CmdProcessor::Command::Condition;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::Condition ; use if !defined @ISA, Devel::Trepan::Condition ;
use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Delete.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Delete; package Devel::Trepan::CmdProcessor::Command::Delete;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;


Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Display.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Display; package Devel::Trepan::CmdProcessor::Command::Display;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::DB::Display ; use if !defined @ISA, Devel::Trepan::DB::Display ;
use if !defined @ISA, Devel::Trepan::Condition ; use if !defined @ISA, Devel::Trepan::Condition ;
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/List.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use lib '../../../..';
# require_relative '../../app/condition' # require_relative '../../app/condition'


package Devel::Trepan::CmdProcessor::Command::List; package Devel::Trepan::CmdProcessor::Command::List;
use English; use English qw( -no_match_vars );
use Devel::Trepan::DB::LineCache; use Devel::Trepan::DB::LineCache;
use Devel::Trepan::CmdProcessor::Validate; use Devel::Trepan::CmdProcessor::Validate;
use if !defined @ISA, Devel::Trepan::CmdProcessor::Command; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command;
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Macro.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Macro; package Devel::Trepan::CmdProcessor::Command::Macro;
use English; use English qw( -no_match_vars );
use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;
unless (defined(@ISA)) { unless (defined(@ISA)) {
eval "use constant CATEGORY => 'support';"; eval "use constant CATEGORY => 'support';";
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Restart.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Restart; package Devel::Trepan::CmdProcessor::Command::Restart;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;
unless (defined(@ISA)) { unless (defined(@ISA)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Undisplay.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine';
use lib '../../../..'; use lib '../../../..';


package Devel::Trepan::CmdProcessor::Command::Undisplay; package Devel::Trepan::CmdProcessor::Command::Undisplay;
use English; use English qw( -no_match_vars );


use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ; use if !defined @ISA, Devel::Trepan::CmdProcessor::Command ;


Expand Down
11 changes: 8 additions & 3 deletions lib/Devel/Trepan/CmdProcessor/Frame.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,17 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org> # Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org>
use strict; use warnings;
package Devel::Trepan::CmdProcessor;

use strict;
use warnings;

# TODO : I don't think this use lib is a good idea.
use lib '../../..'; use lib '../../..';
use Devel::Trepan::DB::Sub; use Devel::Trepan::DB::Sub;
use Devel::Trepan::Complete; use Devel::Trepan::Complete;


package Devel::Trepan::CmdProcessor; use English qw( -no_match_vars );
use English;


sub adjust_frame($$$) sub adjust_frame($$$)
{ {
Expand Down
8 changes: 6 additions & 2 deletions lib/Devel/Trepan/CmdProcessor/Hook.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org> # Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org>
use strict; use warnings; package Devel::Trepan::CmdProcessor::Hook;

use strict;
use warnings;

# TODO : I don't think this lib is a good idea.
use lib '../../..'; use lib '../../..';


use Class::Struct; use Class::Struct;
Expand All @@ -13,7 +18,6 @@ struct CmdProcessorHook => {
}; };




package Devel::Trepan::CmdProcessor::Hook;
# attr_accessor :list # attr_accessor :list


sub new($;$) sub new($;$)
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Location.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use lib '../../..';
# require_relative '../app/default' # require_relative '../app/default'


package Devel::Trepan::CmdProcessor; package Devel::Trepan::CmdProcessor;
use English; use English qw( -no_match_vars );
use Cwd 'abs_path'; use Cwd 'abs_path';


use File::Basename; use File::Basename;
Expand Down
11 changes: 6 additions & 5 deletions lib/Devel/Trepan/CmdProcessor/Running.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org> # Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org>
use strict; use warnings; package Devel::Trepan::CmdProcessor;


use strict;
use warnings;
use feature 'switch'; use feature 'switch';

# TODO : I don't think this use lib is a good idea.
use lib '../../..'; use lib '../../..';


use Devel::Trepan::Position; use Devel::Trepan::Position;
package Devel::Trepan::CmdProcessor; use English qw( -no_match_vars );
use English;




# attr_accessor :stop_condition # String or nil. When not nil # attr_accessor :stop_condition # String or nil. When not nil
# # this has to eval non-nil # # this has to eval non-nil
Expand Down
11 changes: 7 additions & 4 deletions lib/Devel/Trepan/CmdProcessor/Validate.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
# Trepan command input validation routines. A String type is # Trepan command input validation routines. A String type is
# usually passed in as the argument to validation routines. # usually passed in as the argument to validation routines.


use strict; use warnings; package Devel::Trepan::CmdProcessor;
use Exporter;


use strict;
use warnings;
use feature 'switch'; use feature 'switch';
use lib '../../..';


package Devel::Trepan::CmdProcessor; use Exporter;

# TODO : I don't think this use lib is a good idea.
use lib '../../..';


use Cwd 'abs_path'; use Cwd 'abs_path';
use Devel::Trepan::DB::Breakpoint; use Devel::Trepan::DB::Breakpoint;
Expand Down
8 changes: 6 additions & 2 deletions lib/Devel/Trepan/Condition.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org> # Copyright (C) 2011 Rocky Bernstein <rocky@cpan.org>
use strict; use warnings;
package Devel::Trepan::Condition; package Devel::Trepan::Condition;
use English;
use strict;
use warnings;
use English qw( -no_match_vars );

use vars qw(@EXPORT @ISA); use vars qw(@EXPORT @ISA);
@EXPORT = qw( is_valid_condition ); @EXPORT = qw( is_valid_condition );
@ISA = qw(Exporter); @ISA = qw(Exporter);
Expand Down
6 changes: 3 additions & 3 deletions lib/Devel/Trepan/DB.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use lib '../..';
package DB; package DB;
use feature 'switch'; use feature 'switch';
use warnings; no warnings 'redefine'; use warnings; no warnings 'redefine';
use English; use English qw( -no_match_vars );


use vars qw($usrctxt $running $caller use vars qw($usrctxt $running $caller
$event @ret $ret $return_value @return_value $event @ret $ret $return_value @return_value
Expand Down Expand Up @@ -87,11 +87,11 @@ BEGIN {
require threads; require threads;
require threads::shared; require threads::shared;
import threads::shared qw(share); import threads::shared qw(share);
no strict; no warnings; no strict;
no warnings;
$DBGR; $DBGR;
share(\$DBGR); share(\$DBGR);
lock($DBGR); lock($DBGR);
use strict; use warnings;
print "Thread support enabled\n"; print "Thread support enabled\n";
} else { } else {
*lock = sub(*) {}; *lock = sub(*) {};
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/DB/Backtrace.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package DB; package DB;
use warnings; no warnings 'redefine'; use warnings; no warnings 'redefine';
use English; use English qw( -no_match_vars );


=head2 backtrace(skip[,count,scan_for_DB]) =head2 backtrace(skip[,count,scan_for_DB])


Expand Down
9 changes: 7 additions & 2 deletions lib/Devel/Trepan/DB/Breakpoint.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ sub icon_char($)
} }


package DB; package DB;

use vars qw($brkpt $package $lineno $max_bp $max_action); use vars qw($brkpt $package $lineno $max_bp $max_action);
use strict; use warnings; no warnings 'redefine';
use English; use strict;
use warnings;
no warnings 'redefine';

use English qw( -no_match_vars );


BEGIN { BEGIN {
$DB::brkpt = undef; # current breakpoint $DB::brkpt = undef; # current breakpoint
Expand Down
9 changes: 6 additions & 3 deletions lib/Devel/Trepan/DB/Display.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,15 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net> # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
# FIXME: Could combine manager code from breakpoints and display # FIXME: Could combine manager code from breakpoints and display
use strict; use warnings; no warnings 'redefine';
use English; use strict;
use warnings;
no warnings 'redefine';

use English qw( -no_match_vars );
use lib '../..'; use lib '../..';


use Class::Struct; use Class::Struct;
use strict;


struct DBDisplay => { struct DBDisplay => {
number => '$', # breakpoint/action number number => '$', # breakpoint/action number
Expand Down
11 changes: 8 additions & 3 deletions lib/Devel/Trepan/DB/Eval.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,15 @@
# Eval part of Perl's Core DB.pm library and perl5db.pl with modification. # Eval part of Perl's Core DB.pm library and perl5db.pl with modification.


# TODO : Shouldn't this use lib be removed?
use lib '../..'; use lib '../..';


package DB; package DB;
use warnings; use strict;
use English; use warnings;
use strict;
use feature 'switch'; use feature 'switch';

use English qw( -no_match_vars );
use vars qw($eval_result @eval_result %eval_result use vars qw($eval_result @eval_result %eval_result
$eval_str $eval_opts $event $return_type ); $eval_str $eval_opts $event $return_type );


Expand All @@ -30,7 +34,8 @@ sub eval {
$OUTPUT_FIELD_SEPARATOR, $OUTPUT_FIELD_SEPARATOR,
$INPUT_RECORD_SEPARATOR, $INPUT_RECORD_SEPARATOR,
$OUTPUT_RECORD_SEPARATOR, $WARNING) = @saved; $OUTPUT_RECORD_SEPARATOR, $WARNING) = @saved;
no strict; no warnings; no strict;
no warnings;
eval "$user_context $eval_str; &DB::save\n"; # '\n' for nice recursive debug eval "$user_context $eval_str; &DB::save\n"; # '\n' for nice recursive debug
_warnall($@) if $@; _warnall($@) if $@;
} }
Expand Down
Loading