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

Unable to debug with v0.16.0 #68

Closed
hol430 opened this issue Oct 8, 2020 · 4 comments
Closed

Unable to debug with v0.16.0 #68

hol430 opened this issue Oct 8, 2020 · 4 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@hol430
Copy link

hol430 commented Oct 8, 2020

Hi all, just a heads up that after upgrading to v0.16.0 of this extension, I'm unable to debug my C#/mono application. Downgrading to v0.15.8 fixes the problem. Here is my launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/Bin/Progra.exe",
            "cwd": "${workspaceRoot}"
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55555
        }
    ]
}

I'm not sure if there's a log somewhere which I can upload - let me know if there's any extra info I can give. From my perspective, I normally see something in the debug console like this when I start debugging: mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:46391 Bin/Program.exe. When using v0.16.0, however I just see mono Bin/Program.exe, and the program appears to be launched without the debugger attached. The program also doesn't seem to run correctly - I haven't tested extensively but I get some errors along the lines of debugger-agent: Unable to listen on 3 when attempting to compile scripts via System.CodeDom.Compiler.CompileAssemblyFromFile(). I don't get these errors when running normally (e.g. without vscode or vscode-mono-debug).

Apologies if I'm misusing the extension somehow - and let me know if I can provide any other diagnostics.

@akoeplinger
Copy link
Member

Hm this sounds like it might have been caused by 0f7bfa8.

I get some errors along the lines of debugger-agent: Unable to listen on 3 when attempting to compile scripts via System.CodeDom.Compiler.CompileAssemblyFromFile()

I can see how that might happen, if I remember correctly CompileAssemblyFromFile just starts the C# compiler via Process.Start internally. If that gets the MONO_ENV_OPTIONS from the parent process then it'd wait for a debugger connection.

I'll probably need to revert that commit and put it behind an option.

@akoeplinger akoeplinger added the bug Issue identified by VS Code Team member as probable bug label Oct 9, 2020
@akoeplinger
Copy link
Member

Should be fixed now in v0.16.2, thanks for the report!

@hol430
Copy link
Author

hol430 commented Oct 12, 2020

Wonderful, thanks for the fast turnaround on that one. I did notice that on 0.16.2, the break on exception feature seems to be no longer working (it works for me on 0.15.8). Entirely possible that I've done something wrong, just thought I'd check if it's related to the above issue.

In case it helps, here is my configuration. I haven't touched it recently, so it would have been the same when testing against the two different versions of the extension.

"mono-debug.exceptionOptions": {
  "System.Exception": "always",
  "System.SystemException": "always",
  "System.ArithmeticException": "always",
  "System.ArrayTypeMismatchException": "always",
  "System.DivideByZeroException": "always",
  "System.IndexOutOfRangeException": "always",
  "System.InvalidCastException": "always",
  "System.NullReferenceException": "always",
  "System.OutOfMemoryException": "always",
  "System.OverflowException": "always",
  "System.StackOverflowException": "always",
  "System.TypeInitializationException": "always",
  "System.AccessViolationException": "always",
  "System.Configuration.ConfigurationErrorsException": "never",
  "System.IO.FileNotFoundException": "never"
}

@GoaLitiuM
Copy link

I'm having the same issue with 0.16.2, VSCode does not detect hit breakpoints, but debugged application pauses upon hitting that breakpoint and does not respond unless I stop debugging. 0.16.0 Shows an error error while processing request 'stackTrace' (exception: Index was outside the bounds of the array.) when beakpoint is hit. 0.15.8 is the latest vesion that seems to be working just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants