@@ -1285,7 +1285,9 @@ S_sequence_num(pTHX_ const OP *o)
12851285}
12861286
12871287
1288-
1288+ /* forward declaration */
1289+ STATIC void
1290+ S_deb_padvar_cv (pTHX_ CV * cv , PADOFFSET off , int n , bool paren );
12891291
12901292
12911293const struct flag_to_name op_flags_names [] = {
@@ -1379,9 +1381,39 @@ S_do_op_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const OP *o,
13791381 }
13801382 }
13811383
1382- if (o -> op_targ && optype != OP_NULL )
1383- S_opdump_indent (aTHX_ o , level , bar , file , "TARG = %ld\n" ,
1384- (long )o -> op_targ );
1384+ if (o -> op_targ && optype != OP_NULL ) {
1385+ S_opdump_indent (aTHX_ o , level , bar , file , "TARG = %ld ",
1386+ (long )o -> op_targ );
1387+
1388+ /* Display the names of the lexical variables (if any)
1389+ * associated with op_targ */
1390+ int n = 1 ;
1391+
1392+ switch (o -> op_type ) {
1393+ case OP_PADRANGE :
1394+ n = o -> op_private & OPpPADRANGE_COUNTMASK ;
1395+ /* FALLTHROUGH */
1396+ case OP_PADSV :
1397+ case OP_PADAV :
1398+ case OP_PADHV :
1399+ case OP_ARGELEM :
1400+ case OP_PADSV_STORE :
1401+ case OP_AELEMFAST_LEX :
1402+ do_lex :
1403+ PerlIO_puts (file , " " );
1404+ S_deb_padvar_cv (aTHX_ S_get_cv_from_op (aTHX_ o , rootcv ),
1405+ o -> op_targ ,
1406+ n , 1 );
1407+ break ;
1408+
1409+ default :
1410+ if ( (PL_opargs [o -> op_type ] & OA_TARGLEX )
1411+ && (o -> op_private & OPpTARGET_MY ))
1412+ goto do_lex ;
1413+ }
1414+
1415+ PerlIO_puts (file , "\n" );
1416+ }
13851417
13861418 if (o -> op_flags || o -> op_slabbed || o -> op_savefree || o -> op_static ) {
13871419 SV * const tmpsv = newSVpvs ("" );
0 commit comments