[DrKonqi] Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Mar 14 2020, 9:27 AM.

Details

Summary

Port QRegExp::exactMatch() by using QRegularExpression::anchoredPattern(),
unless the pattern is already anchored by "^" and "$".

BacktraceLineGdb::parse():

  • set QRegularExpression::DotMatchesEverythingOption, since gdb breaks some stack frame lines to mulitple lines for readability, e.g.: "#5 0x00007f50e99f776f in QWidget::testAttribute_helper (this=0x6e6440,\n attribute=Qt::WA_WState_Created) at kernel/qwidget.cpp:9081\n" this matches QRegExp behaviour where a "." char matches new lines by default.
  • Use clustering parentheses (?:) so as not to capture groups that aren't needed, less bookkeeping for QRegularExpression/PCRE

Replace QRegularExpression with QString comparison, the latter is usually
faster.

All unit tests still pass.

Diff Detail

Repository
R871 DrKonqi
Branch
l-QRE-port (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23768
Build 23786: arc lint + arc unit
ahmadsamir created this revision.Mar 14 2020, 9:27 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 14 2020, 9:27 AM
ahmadsamir requested review of this revision.Mar 14 2020, 9:27 AM

I wouldn't terribly mind a second pair of eyes.

Code generally looks good to me though, so if nobody else comments feel free to land in a couple days.

src/parser/backtraceparsergdb.cpp
55

s/to/for?

ahmadsamir updated this revision to Diff 77744.Mar 16 2020, 3:45 PM

Fix comment grammar

I wouldn't terribly mind a second pair of eyes.

Code generally looks good to me though, so if nobody else comments feel free to land in a couple days.

OK, thanks.

sitter accepted this revision.Mar 19 2020, 12:49 PM
This revision is now accepted and ready to land.Mar 19 2020, 12:49 PM
This revision was automatically updated to reflect the committed changes.