Skip to content

Debugger could trigger breakpoint in wrong script on case sensitive filesystems #20057

@fflaten

Description

@fflaten

Prerequisites

Steps to reproduce

Run in linux:

"'Hello from LOWERCASE file'" > file.ps1
"'Hello from UPPERCASE file'" > FILE.ps1

# Set breakpoint on lowercase file
Set-PSBreakpoint -Script file.ps1 -Line 1

# Invoke uppercase file
& ./FILE.ps1

# Enters debugger (issue)
Entering debug mode. Use h or ? for help. 

Hit Line breakpoint on '/tmp/file.ps1:1'

At /tmp/FILE.ps1:1 char:1
+ 'Hello from UPPERCASE file'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior

Does not enter debugger as the breakpoint is set for the lowercased file only.

See #20046 (comment).
VSCode extension relies on the current behavior atm because it sets breakpoint using a lowercase drive letter on Windows.

Actual behavior

Enters debugger because breakpoint matches script using OrdinalIgnoreCase string comparison.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productOS-LinuxResolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimeWG-ReviewedA Working Group has reviewed this and made a recommendation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions