Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ internal ScriptDebugger(ExecutionContext context)
_inBreakpoint = false;
_idToBreakpoint = new ConcurrentDictionary<int, Breakpoint>();
// The string key is function context file path. The int key is sequencePoint index.
_pendingBreakpoints = new ConcurrentDictionary<string, ConcurrentDictionary<int, LineBreakpoint>>();
_pendingBreakpoints = new ConcurrentDictionary<string, ConcurrentDictionary<int, LineBreakpoint>>(StringComparer.OrdinalIgnoreCase);
_boundBreakpoints = new ConcurrentDictionary<string, Tuple<WeakReference, ConcurrentDictionary<int, LineBreakpoint>>>(StringComparer.OrdinalIgnoreCase);
_commandBreakpoints = new ConcurrentDictionary<int, CommandBreakpoint>();
_variableBreakpoints = new ConcurrentDictionary<string, ConcurrentDictionary<int, VariableBreakpoint>>(StringComparer.OrdinalIgnoreCase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,20 @@ Describe "Sometimes line breakpoints are ignored" -Tags "CI" {
if (Test-Path -Path $tempFileName2) { Remove-Item $tempFileName2 -Force }
}
}

Describe 'Breakpoints use case-insensitive match for script paths' -Tags 'CI' {
# https://github.com/PowerShell/PowerShell/issues/20044
# Running on Windows only as Set-PSBreakpoint does case sensitive check on provided path on Unix
It 'Hits breakpoint' -Skip:(!$IsWindows) {
$filePath = Join-Path -Path $TestDrive -ChildPath 'demoIssue20044.ps1'
Set-Content -Path $filePath -Value "'Hello World'"

$bp = Set-PSBreakpoint -Script $filePath.ToUpper() -Line 1 -Action { continue }

& $filePath

$bp.HitCount | Should -Be 1

if ($null -ne $bp) { Remove-PSBreakpoint $bp }
}
}