-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signatures: generate only one debug breakable line for signatures #22610
base: blead
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -837,7 +837,7 @@ sigslurpelem: sigslurpsigil sigvarname sigdefault/* def only to catch errors */ | |
yyerror("A slurpy parameter may not have " | ||
"a default value"); | ||
|
||
$$ = var ? newSTATEOP(0, NULL, var) : NULL; | ||
$$ = var ? newSTATEOP(OPf_FORCE_NEXTSTATE, NULL, var) : NULL; | ||
} | ||
; | ||
|
||
|
@@ -913,7 +913,7 @@ sigscalarelem: | |
"follows optional parameter"); | ||
} | ||
|
||
$$ = var ? newSTATEOP(0, NULL, var) : NULL; | ||
$$ = var ? newSTATEOP(OPf_FORCE_NEXTSTATE, NULL, var) : NULL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means that in the debugger it now won't be single-steppable even if there is a defaulting expression. It's hard to predict what users might want here, but maybe it's best to keep the DBSTATE if there is a defop? So maybe defop ? 0 : OPf_FORCE_NEXTSTATE for the flags? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would get annoying in the same way as in #22602 if you had more than a couple of default valued arguments. I think the ideal experience would be to make the debugger display each argument at the signature step points as you step through the signature. Maybe these breakpoints could be optional, but it would need to be controllable at runtime (ie. need a flag on the dbstate), and I expect discoverability of such an option would be bad. I'm not sure of a good approach for the debugger to get the variable set by the argelem. |
||
} | ||
; | ||
|
||
|
@@ -985,7 +985,7 @@ subsigguts: | |
(UNOP_AUX_item *)aux); | ||
sigops = op_prepend_elem(OP_LINESEQ, check, sigops); | ||
sigops = op_prepend_elem(OP_LINESEQ, | ||
newSTATEOP(0, NULL, NULL), | ||
newSTATEOP(OPf_FORCE_NEXTSTATE, NULL, NULL), | ||
sigops); | ||
/* a nextstate at the end handles context | ||
* correctly for an empty sub body */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I save this heredoc as a separate program, what differences should I be able to observe in the behavior of the debugger between, say, perl-5.40.0 and blead+this patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you single-step (
s
) in the debugger, you should see a lot of invisible statements being executed on thesub four($x1, $x2, $x3, $x4) {
line; i.e. you have to repeats
a lot to make the debugger advance into the subroutine.I haven't tried it, but with this patch I'd assume the debugger only stops once and immediately proceeds to the
print
in the subroutine body when you hits
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. In perl-5.40.0, It took me 8
s
steps before theprint
statement executed. In the p.r., it only took 3s
steps. LGTM.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step through the code with "s", pre-patch this steps 6 times on the sub prolog, with patch it steps once