Skip to content
Merged
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
34 changes: 20 additions & 14 deletions lib/dumpvar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -477,26 +477,32 @@ sub main::dumpvar {
$package .= "::" unless $package =~ /::$/;
*stab = *{"main::"};
while ($package =~ /(\w+?::)/g){
*stab = $ {stab}{$1};
*stab = $ {stab}{$1};
}
local $TotalStrings = 0;
local $Strings = 0;
local $CompleteTotal = 0;
while (($key,$val) = each(%stab)) {
return if $DB::signal;
next if @vars && !grep( matchvar($key, $_), @vars );
if ($usageOnly) {
globUsage(\$val, $key)
if ($package ne 'dumpvar' or $key ne 'stab')
and ref(\$val) eq 'GLOB';
} else {
dumpglob(0,$key, $val, 0, $m);
}
for my $key (keys %stab) {
my $val = $stab{$key};
return if $DB::signal;
next if @vars && !grep( matchvar($key, $_), @vars );
if ($usageOnly) {
if (
($package ne 'dumpvar' or $key ne 'stab')
and
(ref(\$val) eq 'GLOB')
) {
globUsage(\$val, $key)
}
}
else {
dumpglob(0,$key, $val, 0, $m);
}
}
if ($usageOnly) {
print "String space: $TotalStrings bytes in $Strings strings.\n";
$CompleteTotal += $TotalStrings;
print "Grand total = $CompleteTotal bytes (1 level deep) + overhead.\n";
print "String space: $TotalStrings bytes in $Strings strings.\n";
$CompleteTotal += $TotalStrings;
print "Grand total = $CompleteTotal bytes (1 level deep) + overhead.\n";
}
}

Expand Down
40 changes: 40 additions & 0 deletions lib/perl5db.t
Original file line number Diff line number Diff line change
Expand Up @@ -3662,6 +3662,46 @@ EOS
$wrapper->contents_like(qr/print "2\\n"/, "break immediately after defining problem");
}

{
# gh #23663 (variant 1)
my $wrapper = DebugWrap->new(
{
cmds =>
[
'b 4',
'X',
'c',
'q',
],
prog => \1,
}
);

$wrapper->contents_unlike(
qr/Use of each\(\) on hash after insertion without resetting hash iterator results in undefined behavior/,
q/gh-23663: 'X' command does not warn about undefined behavior/,
);

# gh #23663 (variant 2)
$wrapper = DebugWrap->new(
{
cmds =>
[
'b 4',
'V main',
'c',
'q',
],
prog => \1,
}
);

$wrapper->contents_unlike(
qr/Use of each\(\) on hash after insertion without resetting hash iterator results in undefined behavior/,
q/gh-23663: 'V main' command does not warn about undefined behavior/,
);
}

done_testing();

END {
Expand Down
Loading