Skip to content

Commit

Permalink
In location, always use :: suffix after package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocky Bernstein committed Aug 12, 2012
1 parent 69c5612 commit fedb2bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/Devel/Trepan/CmdProcessor/Location.pm
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ sub format_location($;$$$)

my $loc = $self->source_location_info;
my $suffix = ($event eq 'return' && defined($DB::_[0])) ? " $DB::_[0]" : '';
my $pkg = $self->{frame}{pkg};
$pkg .= '::' unless $pkg =~ /::/;
"${ev} $pkg(${loc})$suffix"
my $pkg = $self->{frame}{pkg} || '??' ;
"${ev} ${pkg}::(${loc})$suffix";
}

sub print_location($;$)
Expand Down
2 changes: 1 addition & 1 deletion t/20test-trace.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ my $opts = {
my @result = ();
for my $line (split("\n", $got_lines)) {
$line =~ s/\((?:.*\/)?(.+\:\d+)\)/($1)/;
last if (0 == index($line, '-- File::Temp(Temp.pm:'));
last if (0 == index($line, '-- File::Temp::(Temp.pm:'));
push @result, $line;
}

Expand Down
6 changes: 3 additions & 3 deletions t/data/list1.right
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ test-require.pl [1-9]
my $require_file = File::Spec->catfile($DIR, "test-module.pm");
-- main::(test-require.pl:5)
require $require_file;
-- Test::Module(test-module.pm:5)
-- Test::Module::(test-module.pm:5)
my $x = 1;
-- Test::Module(test-module.pm:6)
-- Test::Module::(test-module.pm:6)
my $y = 2;
-- main::(test-require.pl:6)
my $x = Test::Module::five();
-- Test::Module(test-module.pm:3)
-- Test::Module::(test-module.pm:3)
return 5;
test-module.pm [1-6]
1 package Test::Module;
Expand Down
2 changes: 1 addition & 1 deletion t/data/list3.right
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
my $DIR = dirname(__FILE__);
basename is on.
highlight is off.
-- File::Basename(Basename.pm:284)
-- File::Basename::(Basename.pm:284)
my $path = shift;
Basename.pm [280-289]
280 =cut
Expand Down

0 comments on commit fedb2bc

Please sign in to comment.