Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line breakpoint did not work in vscode with netcoreapp3.0 #12

Closed
itn3000 opened this issue Mar 13, 2019 · 7 comments
Closed

line breakpoint did not work in vscode with netcoreapp3.0 #12

itn3000 opened this issue Mar 13, 2019 · 7 comments

Comments

@itn3000
Copy link
Contributor

itn3000 commented Mar 13, 2019

Overview

I tried to use netcoredbg as vscode's debugger with dotnet sdk-3.0pre3.
I set breakpoint, but vscode did not stop at the breakpoint.

Environment

  • os: win8.1-x64
  • vscode: 1.32.1
  • csharp-extension: 1.17.1
  • omnisharp: 1.32.12-beta9
  • netcoredbg: download from release page
  • dotnetcore-sdk: 3.0.100-preview3-010431

Steps to reproduce

  1. creating new console project with dotnet new console
  2. ensure TargetFramework to netcoreapp3.0
  3. build program with dotnet build
  4. add following setting in launch.json to use netcoredbg
  5. set breakpoint at Console.WriteLine
  6. launch vscode's debug session

launch.json setting is following;

        {
            "name": ".NET Core Launch with netcoredbg",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/consolereadkeytest.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "integratedTerminal",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "pipeTransport": {
                "pipeCwd": "${workspaceFolder}",
                "pipeProgram": "cmd",
                "pipeArgs": ["/c"],
                "debuggerPath": "g:/bin/netcoredbg/netcoredbg.exe"
            }
        }

(fix "program" to point "netcoreapp3.0" directory)

Expected Result

stop on Console.WriteLine and variables are displayed.

Actual Result

program exited with code 0.

Notes

  • I also tried at TargetFramwork == netcoreapp2.1 and netcoreapp2.2, breakpoint worked expectedly
  • stop at unhandled exception was worked
  • stop with pause button was worked
@ayuckhulk
Copy link
Contributor

@itn3000 Thank you for the detailed report!
I was not able to reproduce this issue right away (I don't have win8 machine, but on win10 everything worked ok).
Could you please enable engine logging and post the output?

            ...
            "internalConsoleOptions": "openOnSessionStart",

            "logging": {
                "engineLogging": true
            },

            "pipeTransport": {
            ...

Also please enable debugger logs like this and attach them to this issue:

"debuggerPath": "g:/bin/netcoredbg/netcoredbg.exe --log=file"

(log files are created in TEMP folder, you can list them in PowerShell with ls $env:temp\netcore*)

@itn3000
Copy link
Contributor Author

itn3000 commented Mar 14, 2019

Thank you for replying, I made debug logs.
"netcoredbg-vscode-debugconsole.txt" is text from vscode's debug console.
netcoredbg-logs.zip

@itn3000
Copy link
Contributor Author

itn3000 commented Apr 18, 2019

After my investigating, I found I misunderstood the point at issue.

It is not depended on netfm, but on filename case.
In windows, drive letter of filename in pdb is large case when build with dotnet build,
but small case when specified project path with small case(like dotnet build c:\path\to\csproj).
This causes the filename unmatch in ResolveSequencePoint.

I replaced following point to x.Equals(y, StringComparison.OrdinalIgnoreCase), and found debugging works expectedly.

FileNameMatches = s => GetFileName(s) == fileName;
else
FileNameMatches = s => s == filePath;

@ayuckhulk
Copy link
Contributor

@itn3000 Wow, that's really great that you found a solution! Would you be so kind to create a pull request with the fix?

itn3000 added a commit to itn3000/netcoredbg that referenced this issue Apr 18, 2019
@itn3000
Copy link
Contributor Author

itn3000 commented Apr 18, 2019

I created PR as #16, please review it.

@smotti
Copy link

smotti commented Sep 30, 2020

I still encounter issues with non-working breakpoints. The application is a ASP MVC (WebApi) app. Setting breakpoints using vsdbg work as expected.
Also setExceptionsBreakpoints fails, and I don't know why.

Edit: The same is the case for the default console app template.

Environment

Visual Code: 1.49.2
C# Extension: 1.23.2
Omnisharp: 1.37.1
netcoredbg: latest release build (Aug 20)
dotnet core sdk: 3.1.402
OS: Windows_NT x64 10.0.14393 (Windows Server 2016 Datacenter)

Steps to reproduce

The same as OP. Including the debug launch config.

Output

netcoredb_vscode.log

Unfortunately I don't really know where to start looking to help troubleshoot the issue further. So any guidance is appreciated.

Thank you!

@viewizard
Copy link
Member

@smotti I updated netcoredbg sources, could you please check it?
If issue still here, please, open new issue instead.

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

No branches or pull requests

4 participants