Skip to content
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

perl5db.pl: Fix regex in cmd_a allowing short actions #22916

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

zhmylove
Copy link
Contributor

The regex pattern in the a command was updated from (\S.+) to (\S.*) to correctly handle short actions, including single-character expressions after the line number.

There is a problem with a command in perl -d resulting into strange behaviour.
Current version of code my ($lineno, $expr) = $line =~ /^\s*(\d*)\s*(\S.+)/ splits a command a 11 T as: $lineno="1" and $expr="1 T" because it does not accept single characters as $expr.

Replacing it with \S.* fixes the problem:

my @lines = (
    "T",
    "TT",
    "1 T",
    "22 T",
    "3 TT",
    "44 TT",
);

for my $line (@lines) {
    my ($lineno, $expr) = $line =~ /^\s*(\d*)\s*(\S.*)/;
    print "line=$line \t lineno=$lineno \t expr=$expr\n";
}
line=T   lineno=         expr=T
line=TT          lineno=         expr=TT
line=1 T         lineno=1        expr=T
line=22 T        lineno=22       expr=T
line=3 TT        lineno=3        expr=TT
line=44 TT       lineno=44       expr=TT
  • This set of changes does not require a perldelta entry.

@zhmylove zhmylove force-pushed the dev/korg/perldb_cmd_a branch 2 times, most recently from 0071cad to f64a068 Compare January 15, 2025 09:43
The regex pattern in the `a` command was updated from `(\S.+)` to
`(\S.*)` to correctly handle short actions, including single-character
expressions after the line number.

Signed-off-by: Sergei Zhmylev <[email protected]>
@jkeenan
Copy link
Contributor

jkeenan commented Jan 15, 2025

One metadata test is failing n our GH continuous integration setup. You need to increment $VERSION in lib/perl5db.pl.

  534 # bump to X.XX in blead, only use X.XX_XX in maint
  535 $VERSION = '1.81';
  536 
  537 $header = "perl5db.pl version $VERSION";

Please do so, run make test_porting, then, when successful, please re-push the pull request. Thanks.

@zhmylove zhmylove force-pushed the dev/korg/perldb_cmd_a branch from f64a068 to 52b2c5e Compare January 15, 2025 11:55
@zhmylove
Copy link
Contributor Author

@jkeenan thank you so much! Already pushed new code which is passing all the tests

@zhmylove
Copy link
Contributor Author

@jkeenan may I ask you one more question, please? I see that one of the checks -- cygwin -- is skipped. Should I do something in order to run it manually?

@jkeenan
Copy link
Contributor

jkeenan commented Jan 18, 2025

@jkeenan may I ask you one more question, please? I see that one of the checks -- cygwin -- is skipped. Should I do something in order to run it manually?

Don't bother. There's some problem on the Cygwin side, so we have temporarily disabled that particular test run.

@jkeenan
Copy link
Contributor

jkeenan commented Jan 18, 2025

Can we get someone familiar with the debugger's code to review this p.r.?

@khwilliamson khwilliamson merged commit f21b866 into Perl:blead Jan 19, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants