Function Breakpoint ignores the Condition
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 737
- Avg merge
- 17h 56m
- Merged PRs (30d)
- 21
Description
## Issue Description ##
Hello. I am adding a function breakpoint from an custom vscode extension that I am writing. I want this breakpoint to be hit only for specified thread name. So in the custom vscode extension, I create and add a new function breakpoint with specified condition. The code is as follows:
const bps: vscode.Breakpoint[] = []
let condition = "System.Threading.Thread.CurrentThread.Name==\"TestThreadName\""
let functionBreakpoint = new vscode.FunctionBreakpoint("Execute", true, condition)
bps.push(functionBreakpoint)
vscode.debug.addBreakpoints(bps)
The function breakpoint is added to the Breakpoint list:

When I trigger the Execute method the breakpoint is being always hit regarding the current thread name.
Execute method hit when the thread name is TestThreadName. Correct.

Execute method should not be hit when the thread name is null. False.

Are conditions to Function breakpoints supported?
## Expected Behavior ##
The function breakpoint should be hit when the condition is meet.
## Actual Behavior ##
Function breakpoint is being hit ignoring the condition statement.
## Environment information ##
**VSCode version**: 1.51.1
**C# Extension**: 1.23.6
Dotnet Information
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
5.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
|Extension|Author|Version|
|---|---|---|
|csharp|ms-dotnettools|1.23.6|
|vscode-icons|vscode-icons-team|11.0.0|
|vscodeintellicode|VisualStudioExptTeam|1.2.10|;
Contributor guide
Assessment
This issue has not been assessed yet.