Branch: refs/heads/davem/Dx_varname
Home: https://github.com/Perl/perl5
Commit: 899a35670c5c92eef914c4c132f7c3c16c25233e
https://github.com/Perl/perl5/commit/899a35670c5c92eef914c4c132f7c3c16c25233e
Author: David Mitchell <[email protected]>
Date: 2025-11-12 (Wed, 12 Nov 2025)
Changed paths:
M dump.c
Log Message:
-----------
dump.c: add S_deb_padvar_cv() function
Make S_deb_padvar() a thin wrapper over a new S_deb_padvar_cv() function,
which does the same thing (display a pad variable name), but does it for
a specified CV rather than only for the currently executing CV. This
function will be used shorty.
Commit: dcabdfcfec6547746f0846417ac093791dbc6fe9
https://github.com/Perl/perl5/commit/dcabdfcfec6547746f0846417ac093791dbc6fe9
Author: David Mitchell <[email protected]>
Date: 2025-11-12 (Wed, 12 Nov 2025)
Changed paths:
M dump.c
Log Message:
-----------
dump.c: add S_get_cv_from_op() function
The existing S_get_sv_from_pad() function does two things: it finds the
CV associated with the specified op, and then extracts something from
that CV's pad.
This commit splits the 'find the associated CV' part of the code out
into a separate function, which will be used elsewhere shortly.
Commit: 15cceca381cc2513837195659335bb760c212027
https://github.com/Perl/perl5/commit/15cceca381cc2513837195659335bb760c212027
Author: David Mitchell <[email protected]>
Date: 2025-11-12 (Wed, 12 Nov 2025)
Changed paths:
M dump.c
Log Message:
-----------
op_dump(): display names of variables for pad ops.
Make op_dump(), as used by 'perl -Dx', display the names of pad
variables when dumping pad ops.
The runtime perl -Dt already does this (note the $x, $y etc appearing in
the op name displays):
$ perl -Dt -e'my ($x, $y); $y = 1+$x'
(-e:0) enter
(-e:0) nextstate
(-e:1) padrange($x,$y)
(-e:1) nextstate
(-e:1) const(IV(1))
(-e:1) padsv($x)
(-e:1) add($y)
(-e:1) leave
While the (typically compile-time) -Dx detailed optree dumping didn't.
Here are some 'before this commit' and 'after' examples of how some of
those ops were/are now displayed. Note the changes in the 'TARG = N'
lines for the following code:
$ perl -Dx -e'my ($x, $y); $y = 1+$x'
Before:
4 | +--padrange OP(0x31b08960) ===> 6 [nextstate 0x31b09fc0]
| | TARG = 1
| | FLAGS = (VOID,MOD,SLABBED,MORESIB)
| | PRIVATE = (LVINTRO,range=0x2)
10 +--add BINOP(0x31b0a060) ===> 1 [leave 0x31b08880]
TARG = 2
FLAGS = (VOID,KIDS,SLABBED)
PRIVATE = (TARGMY,0x2)
11 +--padsv OP(0x31b0a0a0) ===> 10 [add 0x31b0a060]
TARG = 1
FLAGS = (SCALAR,SLABBED)
After:
4 | +--padrange OP(0x18ffe920) ===> 6 [nextstate 0x18ffff80]
| | TARG = 1 ($x,$y)
| | FLAGS = (VOID,MOD,SLABBED,MORESIB)
| | PRIVATE = (LVINTRO,range=0x2)
10 +--add BINOP(0x19000020) ===> 1 [leave 0x18ffe840]
TARG = 2 ($y)
FLAGS = (VOID,KIDS,SLABBED)
PRIVATE = (TARGMY,0x2)
11 +--padsv OP(0x19000060) ===> 10 [add 0x19000020]
TARG = 1 ($x)
FLAGS = (SCALAR,SLABBED)
Compare: https://github.com/Perl/perl5/compare/899a35670c5c%5E...15cceca381cc
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications