summaryrefslogtreecommitdiff
path: root/lib/sigtrap.pm
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters.nicoh.com>1996-01-11 22:23:31 +0000
committerAndy Dougherty <doughera.lafayette.edu>1996-01-11 22:23:31 +0000
commitd338d6fe1dfdfdbc07c2d6d7a2a4ae7db5887d93 (patch)
treef2bd2ca1e29809b151d4347e03ab21401e445d60 /lib/sigtrap.pm
parentcb31d310dc4aae93633aea7091120c88086f29fc (diff)
downloadperl-d338d6fe1dfdfdbc07c2d6d7a2a4ae7db5887d93.tar.gz
Ilya's new debugger.
Diffstat (limited to 'lib/sigtrap.pm')
-rw-r--r--lib/sigtrap.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/sigtrap.pm b/lib/sigtrap.pm
index dd4df906fa..e099ac4658 100644
--- a/lib/sigtrap.pm
+++ b/lib/sigtrap.pm
@@ -47,19 +47,29 @@ sub trap {
syswrite(STDERR, "\n", 1);
# Now go for broke.
- for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) {
- @a = ();
+ for ($i = 1; ($p,$f,$l,$s,$h,$w,$e,$r) = caller($i); $i++) {
+ @a = ();
for $arg (@args) {
$_ = "$arg";
- s/'/\\'/g;
+ s/([\'\\])/\\$1/g;
s/([^\0]*)/'$1'/
- unless /^(?: -?[\d.]+ | \*[\w:]* )$/x;
+ unless /^(?: -?[\d.]+ | \*[\w:]* )$/x;
s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg;
s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg;
push(@a, $_);
}
$w = $w ? '@ = ' : '$ = ';
$a = $h ? '(' . join(', ', @a) . ')' : '';
+ $e =~ s/\n\s*\;\s*\Z// if $e;
+ $e =~ s/[\\\']/\\$1/g if $e;
+ if ($r) {
+ $s = "require '$e'";
+ } elsif (defined $r) {
+ $s = "eval '$e'";
+ } elsif ($s eq '(eval)') {
+ $s = "eval {...}";
+ }
+ $f = "file `$f'" unless $f eq '-e';
$mess = "$w$s$a called from $f line $l\n";
syswrite(STDERR, $mess, length($mess));
}