Skip to content

LT-22889 Add debugging possibiities to PcPatrFLEx - #1237

Merged
AndyBlack merged 11 commits into
mainfrom
LT22889
Nov 10, 2026
Merged

AndyBlack merged 11 commits into
mainfrom
LT22889

Conversation

@AndyBlack

@AndyBlack AndyBlack commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

This adds three options to the Use PcPatr with FLEx utility dialog. The first option is what we have been using. The two new ones are for debugging a PC-PATR grammar. When a user clicks on either of the two new options, they will flash red as a warning to be careful when using these. They change the content of the PcPatrFLEx.tak file.

It adds four new items to the PCPATR custom list.

The change also includes enhancements to the user documentation, including a new reference web page.


This change is Reviewable

Change-Id: Ib4fe0cf04496ffdb44f4c2a6d11f36a8694ac409
Change-Id: If4150ba3a95346b9cc4747bd811793d6587b0816
Change-Id: I5261538de08b6ac14b216b848a9d77b4ea770761
Change-Id: I5b4971876348c910a98256c71973c82f05f680b0
Change-Id: Ie058512bae5d313aeb0b23a84dad45a8b0a05315
Change-Id: Ie3f9e4a1d573f9001a33e497ef7d79299a124a61
Change-Id: I2b7e237414ee147397578359a2e3e82d04cbeb6d
Change-Id: I518d6cf1641b3d9a99161ac26b8c50bb6292ac48
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   11m 5s ⏱️ - 3m 7s
7 058 tests +1  6 973 ✅ +1  85 💤 ±0  0 ❌ ±0 
7 067 runs  +1  6 982 ✅ +1  85 💤 ±0  0 ❌ ±0 

Results for commit 5e6b173. ± Comparison against base commit 412ee26.

♻️ This comment has been updated with latest results.

@codecov-commenter

codecov-commenter commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 40.52%. Comparing base (c734bff) to head (5e6b173).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...s/pcpatrflex/DisambiguateInFLExDB/PCPatrInvoker.cs 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1237      +/-   ##
==========================================
+ Coverage   39.93%   40.52%   +0.58%     
==========================================
  Files        1542     1559      +17     
  Lines      355165   356108     +943     
  Branches    41317    41590     +273     
==========================================
+ Hits       141833   144297    +2464     
+ Misses     183999   182498    -1501     
+ Partials    29333    29313      -20     
Files with missing lines Coverage Δ
Src/Utilities/pcpatrflex/PrepFLExDBDll/Preparer.cs 98.13% <100.00%> (+0.02%) ⬆️
...s/pcpatrflex/DisambiguateInFLExDB/PCPatrInvoker.cs 93.96% <93.75%> (-0.21%) ⬇️

... and 115 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thejambi

thejambi commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Src/Utilities/pcpatrflex/PcPatrFLExDll/PcPatrFLExForm.cs line 137 at r1 (raw file):

						btnDisambiguate.Enabled = false;
					Cursor.Current = Cursors.Default;
					SetupFlashingTimer();

Clicking a Show Failures option crashes on first launch

SetupFlashingTimer() and UpdateShowFailuresChecked() are only called inside if (regkey != null). The registry key is only created when the form closes, in SaveRegistryInfo, so it doesn't exist the first time someone opens PcPatrFLEx.

On that first launch flashTimer stays null. Clicking any of the three Show Failures options runs UpdateShowFailuresValue, which calls flashTimer.Stop() or flashTimer.Start() and throws an unhandled NullReferenceException. The group also opens with no option selected, because UpdateShowFailuresChecked() is skipped too.

Suggested fix: move both calls out of the if block, for example just before AdjustSplitterLocation();:

}
SetupFlashingTimer();
UpdateShowFailuresChecked();
AdjustSplitterLocation();

@thejambi thejambi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thejambi reviewed 18 files and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on AndyBlack).

Change-Id: Iff34ea0e4d8294cb919e4cb540d2d3ffa47c3e1e
@thejambi

thejambi commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Src/Utilities/pcpatrflex/PcPatrFLExDll/PcPatrFLExForm.cs line 902 at r2 (raw file):

		private void SetupFlashingTimer()
		{
			flashTimer = new Timer();

Flash timer keeps running after the dialog closes

flashTimer is created with new Timer(). It isn't added to components, and nothing stops or disposes it when the form closes.

If PcPatrFLEx is closed while a debug option is selected, the timer keeps ticking inside the FLEx process. While it runs, it keeps the closed form in memory through its Tick handler. Each open-and-close in a debug mode leaves another form and timer behind.

Suggested fix: stop and dispose the timer in OnFormClosing:

private void OnFormClosing(object sender, EventArgs e)
{
	flashTimer?.Stop();
	flashTimer?.Dispose();
	SaveRegistryInfo();
}

Change-Id: I620404df9c631a92e8901274c1660e84c74ecae7
Change-Id: Ifbe7aee810f46934b905ad249d479db5dec61ed5

@thejambi thejambi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thejambi reviewed 2 files and all commit messages, and resolved 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on AndyBlack).

@AndyBlack
AndyBlack merged commit 878627b into main Nov 10, 2026
9 checks passed
@AndyBlack
AndyBlack deleted the LT22889 branch November 10, 2026 15:22
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