diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2021-06-23 16:51:16 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2021-06-23 16:51:16 +0000 |
commit | 31ec0f485d274a29d3b1cc9f1d2bd60e5cf8768c (patch) | |
tree | b31e74964f6425c764d1e97091b11225fe28a896 /gnu | |
parent | b33159ef040c969c19b8c5c5e349de302c7f969d (diff) |
help the debugger look in ports for external parts like PadWalker
and Readline.
feedback and okay afresh1@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/perl/lib/perl5db.pl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gnu/usr.bin/perl/lib/perl5db.pl b/gnu/usr.bin/perl/lib/perl5db.pl index 69a9bb6e643..b4025116be4 100644 --- a/gnu/usr.bin/perl/lib/perl5db.pl +++ b/gnu/usr.bin/perl/lib/perl5db.pl @@ -1799,6 +1799,15 @@ our ( @old_watch, ); +sub _DB__use_full_path +{ + local @INC = @INC; + eval { require Config; }; + unshift(@INC, + @Config::Config{qw(archlibexp privlibexp sitearchexp sitelibexp)}); + &{$_[0]}; +} + sub _DB__determine_if_we_should_break { # if we have something here, see if we should break. @@ -1961,7 +1970,10 @@ sub _DB__handle_y_command { if (!eval { local @INC = @INC; pop @INC if $INC[-1] eq '.'; - require PadWalker; PadWalker->VERSION(0.08) }) { + _DB__use_full_path(sub { + require PadWalker; + }); + PadWalker->VERSION(0.08) }) { my $Err = $@; _db_warn( $Err =~ /locate/ @@ -6818,13 +6830,15 @@ the appropriate attributes. We then use vars qw($ornaments); use vars qw($rl_attribs); - sub setterm { # Load Term::Readline, but quietly; don't debug it and don't trace it. local $frame = 0; local $doret = -2; - require Term::ReadLine; + _DB__use_full_path(sub { + require Term::ReadLine; + }); + # If noTTY is set, but we have a TTY name, go ahead and hook up to it. if ($notty) { @@ -6999,7 +7013,9 @@ qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\ # We need $term defined or we can not switch to the newly created xterm if ($tty ne '' && !defined $term) { - require Term::ReadLine; + _DB__use_full_path(sub { + require Term::ReadLine; + }); if ( !$rl ) { $term = Term::ReadLine::Stub->new( 'perldb', $IN, $OUT ); } @@ -8833,7 +8849,7 @@ sub CvGV_name_or_bust { return if $skipCvGV; # Backdoor to avoid problems if XS broken... return unless ref $in; $in = \&$in; # Hard reference... - eval { require Devel::Peek; 1 } or return; + eval { _DB__use__full_path(sub { require Devel::Peek; 1;}); } or return; my $gv = Devel::Peek::CvGV($in) or return; *$gv{PACKAGE} . '::' . *$gv{NAME}; } ## end sub CvGV_name_or_bust |