summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Guy <mjtg@cam.ac.uk>2001-06-24 16:28:39 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-24 13:50:26 +0000
commit25f5609c00aaa1dfc8054cef4afd8c7e81a15a00 (patch)
treeca521cfb2d1a55727b5044bbdab7070aa90f5ef1 /lib
parente7766f8964be5cd2150ea7e46155fe2cd06b8017 (diff)
downloadperl-25f5609c00aaa1dfc8054cef4afd8c7e81a15a00.tar.gz
Re: [ID 20010624.001] debugger T, and Carp::carp don't trace arg of
Message-Id: <E15EAsR-0007Bi-00@draco.cus.cam.ac.uk> Fix an ancient (5.002) bug. p4raw-id: //depot/perl@10891
Diffstat (limited to 'lib')
-rw-r--r--lib/Carp/Heavy.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm
index 9d3e000aa9..06d57b5be0 100644
--- a/lib/Carp/Heavy.pm
+++ b/lib/Carp/Heavy.pm
@@ -28,8 +28,7 @@ sub caller_info {
my $sub_name = Carp::get_subname(\%call_info);
if ($call_info{has_args}) {
- # Reuse the @args array to avoid warnings. :-)
- local @args = map {Carp::format_arg($_)} @args;
+ my @args = map {Carp::format_arg($_)} @args;
if ($MaxArgNums and @args > $MaxArgNums) { # More than we want to show?
$#args = $MaxArgNums;
push @args, '...';
@@ -120,7 +119,7 @@ sub long_error_loc {
sub longmess_heavy {
- return @_ if ref($_[0]); # WHAT IS THIS FOR???
+ return @_ if ref($_[0]); # don't break references as exceptions
my $i = long_error_loc();
return ret_backtrace($i, @_);
}
@@ -139,19 +138,19 @@ sub ret_backtrace {
$tid_msg = " thread $tid" if $tid;
}
- if ($err =~ /\n$/) {
+ { if ($err =~ /\n$/) { # extra block to localise $1 etc
$mess = $err;
}
else {
my %i = caller_info($i);
$mess = "$err at $i{file} line $i{line}$tid_msg\n";
- }
+ }}
while (my %i = caller_info(++$i)) {
$mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n";
}
- return $mess || $err;
+ return $mess;
}
sub ret_summary {
@@ -190,7 +189,7 @@ sub short_error_loc {
sub shortmess_heavy {
return longmess_heavy(@_) if $Verbose;
- return @_ if ref($_[0]); # WHAT IS THIS FOR???
+ return @_ if ref($_[0]); # don't break references as exceptions
my $i = short_error_loc();
if ($i) {
ret_summary($i, @_);