Coder Social home page Coder Social logo

vscode-mono-debug's Introduction

VS Code Mono Debug

A simple VS Code debugger extension for the Mono VM. Its implementation was inspired by the SDB command line debugger.

Mono Debug

Installing Mono

You can either download the latest Mono version for Linux, macOS, or Windows at the Mono project website or you can use your package manager.

  • On OS X: brew install mono
  • On Ubuntu, Debian, Raspbian: sudo apt-get install mono-complete
  • On CentOS: yum install mono-complete
  • On Fedora: dnf install mono-complete

Enable Mono debugging

To enable debugging of Mono based C# (and F#) programs, you have to pass the -debug option to the compiler:

csc -debug Program.cs

If you want to attach the VS Code debugger to a Mono program, pass these additional arguments to the Mono runtime:

mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555 Program.exe

The corresponding attach launch.json configuration looks like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Mono",
            "request": "attach",
            "type": "mono",
            "address": "localhost",
            "port": 55555
        }
    ]
}

Building the mono-debug extension

build status

Building and using VS Code mono-debug requires a basic POSIX-like environment, a Bash-like shell, and an installed Mono framework.

First, clone the mono-debug project:

$ git clone --recursive https://github.com/microsoft/vscode-mono-debug

To build the extension vsix, run:

$ cd vscode-mono-debug
$ npm install
$ make

vscode-mono-debug's People

Contributors

akoeplinger avatar angrieco avatar autonomiccoder avatar chrisdias avatar cindra10 avatar cwensley avatar dependabot[bot] avatar filipw avatar isidorn avatar joaomoreno avatar jonathanpeppers avatar lukaszunity avatar microsoft-github-policy-service[bot] avatar redth avatar t-h-e avatar thaystg avatar weinand avatar willforan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-mono-debug's Issues

Breakpoints in files from symlinked dirs

When directory /foo/src/build is a symlink to /bar/build, we open a file /foo/src/build/file.cs and place a breakpoint there - breakpoints will hit, however IDE will reopen file from /bar/build/file.cs path. VSCode thinks it is a different file and thus placed breakpoints are not visible. Debugging works otherwise.

Could this plugin use /foo/src/build/file.cs provided it is the same file that debugging info points to?

By the way - awesome plugin! Thank you ๐Ÿ‘

How to debug embedded mono?

I have a barebones C++ project, in which I have embedded Mono according to the documentation.

I have then created a simple .cs file with a class with a couple of test functions that print some strings. I compile this file with the this command:

mcs SomeClass.cs -debug -target:library

As expected, I get a C# SomeClass.dll and a debug symbol file SomeClass.dll.mbd.

I can load the dll assembly from C++ (from the embedded Mono runtime) and call the functions inside the dll. I can step through the native code (C++) in VS Code. However, I can't figure it out how to step through/debug the managed C# code.

Here's the meat of my launch.json file:

{
            "name": "Launch",
            "type": "lldb",
            "request": "launch",
            "program": "path/to/EmbeddedMono.exe",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "externalTerminal"
},
{
            "name": "Attach to Mono",
            "request": "attach",
            "type": "mono",
            "address": "localhost",
            "port": 55555
 }

I also pass some command line options to the embedded Mono runtime:

    static const char* options[] = {
          "--soft-breakpoints",
          "--debugger-agent=transport=dt_socket,address=127.0.0.1:55555"
        };
    mono_jit_parse_options(sizeof(options)/sizeof(char*), (char**)options);
    mono_debug_init(MONO_DEBUG_FORMAT_MONO);

I imagined that I could launch the program, step through native code, then attach to Mono and step through managed C# code. However, the embedded Mono runtime always terminates the native program with this error message:

debugger-agent: Unable to connect to 127.0.0.1:55555

I am at a total loss. I can debug pure C# code, without any embedded Mono runtime, I can debug native code. However, I can not debug any C# code that is executed in a embedded Mono runtime.

Ideally I would like to step through both C++ & C# seamlessly, just like how Visual Studio can. However, I would be quite content if I could at least be able to debug either native code or managed C# code, one at a time. Unfortunately the latter doesn't seem to be working.

make: vsce: No such file or directory on OSX

Running make on OSX with the latest version builds ok, but the extension seems to fail.

โžœ  vscode-mono-debug git:(master) make
git submodule update --init --recursive
cd sdb; make -f Makefile
make[1]: Nothing to be done for `all'.
xbuild /p:Configuration=Release mono-debug.sln
XBuild Engine Version 12.0
Mono, Version 4.0.1.0
Copyright (C) 2005-2013 Various Mono authors

Build started 16/04/2016 08:45:43.
__________________________________________________
Project "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/mono-debug.sln" (default target(s)):
    Target ValidateSolutionConfiguration:
        Building solution configuration "Release|Any CPU".
    Target Build:
        Project "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/mono-debug.csproj" (default target(s)):
            Target RestorePackages:
                Executing: mono --runtime=v4.0.30319 "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/.nuget/NuGet.exe" install "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/packages.config" -source ""   -RequireConsent -solutionDir "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/"
                Restoring NuGet packages...
                To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
            Target PrepareForBuild:
                Configuration: Release Platform: AnyCPU
            Target GenerateSatelliteAssemblies:
            No input files were specified for target GenerateSatelliteAssemblies, skipping.
            Target GenerateTargetFrameworkMonikerAttribute:
            Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
            Target CoreCompile:
            Skipping target "CoreCompile" because its outputs are up-to-date.
            Target _CopyDeployFilesToOutputDirectoryAlways:
                Copying file from '/Users/ricardocampos/Code/dotNet/vscode-mono-debug/TerminalHelper.scpt' to '/Users/ricardocampos/Code/dotNet/vscode-mono-debug/bin/Release/TerminalHelper.scpt'
        Done building project "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/mono-debug.csproj".
Done building project "/Users/ricardocampos/Code/dotNet/vscode-mono-debug/mono-debug.sln".

Build succeeded.
     0 Warning(s)
     0 Error(s)

Time Elapsed 00:00:00.5858040
vsce package
make: vsce: No such file or directory
make: *** [vsix] Error 1

build failed, macos 10.13.6, src/MonoDebugSession.cs(11,7): error CS0246: The type or namespace name 'Mono' could not be found

$ which mono
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono

$ mono --version
Mono JIT compiler version 5.16.0.221 (2018-06/b63e5378e38 Mon Nov 19 18:08:09 EST 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(3.6.0svn-mono-release_60/0b3cb8ac12c)
	GC:            sgen (concurrent by default)
$ npm install
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> [email protected] postinstall /Users/stephen/dev/vscode-mono-debug
> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^1.8.0
Found minimal version that qualifies engine range: 1.8.0
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/38746938a4ab94f2f57d9e1309c51fd6fb37553d/src/vs/vscode.d.ts
vscode.d.ts successfully installed!

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> [email protected] prepublish /Users/stephen/dev/vscode-mono-debug
> make build

msbuild /p:Configuration=Release mono-debug.sln
Microsoft (R) Build Engine version 16.0.40-preview+ge6c3a1f9e4 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 12/4/2018 2:57:59 AM.
Project "/Users/stephen/dev/vscode-mono-debug/mono-debug.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Any CPU".
Project "/Users/stephen/dev/vscode-mono-debug/mono-debug.sln" (1) is building "/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj" (2) on node 1 (default targets).
RestorePackages:
  mono --runtime=v4.0.30319 "/Users/stephen/dev/vscode-mono-debug/.nuget/NuGet.exe" install "/Users/stephen/dev/vscode-mono-debug/packages.config" -source ""   -RequireConsent -solutionDir "/Users/stephen/dev/vscode-mono-debug/"
  Restoring NuGet packages...
  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
  Installing 'ICSharpCode.NRefactory 5.5.1'.
  Successfully installed 'ICSharpCode.NRefactory 5.5.1'.
  Installing 'Mono.Cecil 0.9.6.1'.
  Successfully installed 'Mono.Cecil 0.9.6.1'.
  Installing 'Mono.Debugger.Soft 1.0.20161020.46'.
  Successfully installed 'Mono.Debugger.Soft 1.0.20161020.46'.
  Installing 'Mono.Debugging 1.0.20161020.46'.
  Successfully installed 'Mono.Debugging 1.0.20161020.46'.
  Installing 'Mono.Debugging.Soft 1.0.20161020.46'.
  Successfully installed 'Mono.Debugging.Soft 1.0.20161020.46'.
  Installing 'Newtonsoft.Json 9.0.1'.
  Successfully installed 'Newtonsoft.Json 9.0.1'.
PrepareForBuild:
  Creating directory "bin/Release/".
  Creating directory "obj/Release/".
ResolveAssemblyReferences:
  Primary reference "ICSharpCode.NRefactory".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "ICSharpCode.NRefactory.CSharp".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Mono.Cecil".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Mono.Cecil.Mdb".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Mono.Debugger.Soft".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugger.Soft.1.0.20161020.46\lib\net40\Mono.Debugger.Soft.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugger.Soft.1.0.20161020.46\lib\net40\Mono.Debugger.Soft.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Mono.Debugging.Soft".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.Soft.1.0.20161020.46\lib\net40\Mono.Debugging.Soft.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.Soft.1.0.20161020.46\lib\net40\Mono.Debugging.Soft.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Mono.Debugging".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.1.0.20161020.46\lib\net40\Mono.Debugging.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.1.0.20161020.46\lib\net40\Mono.Debugging.dll".
      Reference found at search path location "{HintPathFromItem}".
  Primary reference "Newtonsoft.Json".

/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
      Resolved file path is "/Users/stephen/dev/vscode-mono-debug/packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll".
      Reference found at search path location "{HintPathFromItem}".

CoreCompile:
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Roslyn/csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /highentropyva+ /reference:/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/4.5-api/Microsoft.CSharp.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/4.5-api/mscorlib.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/4.5-api/System.Core.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/4.5-api/System.dll /optimize+ /out:obj/Release/mono-debug.exe /subsystemversion:6.00 /target:exe /utf8output Properties/AssemblyInfo.cs src/MonoDebugSession.cs src/Handles.cs src/Utilities.cs src/DebugSession.cs src/MonoDebug.cs src/Protocol.cs "/var/folders/x6/kq4xq7rx6nz15ys_d9nnd3980000gq/T/.NETFramework,Version=v4.5.AssemblyAttributes.cs"

src/MonoDebugSession.cs(11,7): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Utilities.cs(14,7): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Protocol.cs(10,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(830,58): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(835,11): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(854,35): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(918,11): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(925,11): error CS0246: The type or namespace name 'Backtrace' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(930,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(941,11): error CS0246: The type or namespace name 'ExceptionInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Protocol.cs(86,4): error CS0246: The type or namespace name 'JsonPropertyAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Protocol.cs(86,4): error CS0246: The type or namespace name 'JsonProperty' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Protocol.cs(86,17): error CS0246: The type or namespace name 'PropertyName' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/Utilities.cs(172,23): error CS0246: The type or namespace name 'ICustomLogger' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(32,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(34,11): error CS0246: The type or namespace name 'ProcessInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(35,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(37,34): error CS0246: The type or namespace name 'BreakEvent' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(38,16): error CS0246: The type or namespace name 'Catchpoint' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(39,11): error CS0246: The type or namespace name 'DebuggerSessionOptions' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(42,19): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(43,19): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
src/MonoDebugSession.cs(44,11): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]

Done Building Project "/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj" (default targets) -- FAILED.
Done Building Project "/Users/stephen/dev/vscode-mono-debug/mono-debug.sln" (default targets) -- FAILED.

Build FAILED.

"/Users/stephen/dev/vscode-mono-debug/mono-debug.sln" (default target) (1) ->
"/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) -> 
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugger.Soft.1.0.20161020.46\lib\net40\Mono.Debugger.Soft.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.Soft.1.0.20161020.46\lib\net40\Mono.Debugging.Soft.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Mono.Debugging.1.0.20161020.46\lib\net40\Mono.Debugging.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2130,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not find file "/Users/stephen/dev/vscode-mono-debug/packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]


"/Users/stephen/dev/vscode-mono-debug/mono-debug.sln" (default target) (1) ->
"/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj" (default target) (2) ->
(CoreCompile target) -> 
  src/MonoDebugSession.cs(11,7): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Utilities.cs(14,7): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Protocol.cs(10,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(830,58): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(835,11): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(854,35): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(918,11): error CS0246: The type or namespace name 'ThreadInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(925,11): error CS0246: The type or namespace name 'Backtrace' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(930,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(941,11): error CS0246: The type or namespace name 'ExceptionInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Protocol.cs(86,4): error CS0246: The type or namespace name 'JsonPropertyAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Protocol.cs(86,4): error CS0246: The type or namespace name 'JsonProperty' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Protocol.cs(86,17): error CS0246: The type or namespace name 'PropertyName' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/Utilities.cs(172,23): error CS0246: The type or namespace name 'ICustomLogger' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(32,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(34,11): error CS0246: The type or namespace name 'ProcessInfo' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(35,11): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(37,34): error CS0246: The type or namespace name 'BreakEvent' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(38,16): error CS0246: The type or namespace name 'Catchpoint' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(39,11): error CS0246: The type or namespace name 'DebuggerSessionOptions' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(42,19): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(43,19): error CS0246: The type or namespace name 'Mono' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]
  src/MonoDebugSession.cs(44,11): error CS0246: The type or namespace name 'ObjectValue' could not be found (are you missing a using directive or an assembly reference?) [/Users/stephen/dev/vscode-mono-debug/mono-debug.csproj]

    8 Warning(s)
    23 Error(s)

Time Elapsed 00:00:20.79
make: *** [ONO_DEBUG_RELEASE] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prepublish: `make build`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/stephen/.npm/_logs/2018-12-04T07_58_20_218Z-debug.log

args array passed as a single argument when launching a mono program

From @alfonsogarciacaro on February 9, 2016 20:22

Hi there! I'm experiencing an issue when debugging mono with the new version (0.10.8). This my launch configuration:

        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "path/to/program.exe",
            "args": ["--projFile", "../../temp/Test.fsx"]
        }

Before, VS Code would pass two arguments to the program, but now it passes a single one with both strings joined without spaces ("--projFile../../temp/Test.fsx").

Please tell me if you need more info and thanks for your hard work!

Copied from original issue: microsoft/vscode#2862

A issue of using Mono Debug to debug a example with gui.

From @tengxianbing on March 1, 2017 12:32

  • VSCode Version: Code 1.9.1 (f9d0c687ff2ea7aabd85fb9a43129117c0ecf519, 2017-02-08T23:44:55.542Z)
  • OS Version: Linux x64 3.19.0-80-generic
  • Extensions:
Extension Author Version
cpptools ms-vscode 0.10.1
csharp ms-vscode 1.7.0
mono-debug ms-vscode 0.15.3

Steps to Reproduce:

  1. Use mono-debug to debug a c# example with gui, it works.
  2. The debug feature doesn't work(can't step over or step into to watch variables) when the gui of example showing.
  3. Could you help check?

Copied from original issue: microsoft/vscode#21626

Debugging with mono and building with xbuild breaks debugging!

From @chncy on April 15, 2017 16:56

  • VSCode Version: 1.11.2
  • OS Version: Debian 8 jessie 64-bit

Steps to Reproduce:

  1. Use mono in launch.json and xbuild for building
  2. Try to debug program: Code execution pauses at breakpoint but i cant see variables, watch them or even see where the code is currently paused at.

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/SteamBot/bin/Debug/SteamBot.exe",
            "args": ["getrightsucks", "Sk1ns7Pur"],
            "cwd": "${workspaceRoot}/SteamBot/bin/Debug/",
            "preLaunchTask": "build",
            "runtimeExecutable": null,
            "env": {}
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55555
        }
    ]
}

tasks.json:

{
    "version": "0.1.0",
    "command": "xbuild",
    "args": [
        "/property:GenerateFullPaths=true /debug:full /debug+"
    ],
    "taskSelector": "/t:",
    "showOutput": "silent",
    "tasks": [
        {
            "taskName": "build",
            "showOutput": "silent",
            "problemMatcher": "$msCompile"
        }
    ]
}

Copied from original issue: microsoft/vscode#24831

Debugging is broken

From @borgdylan on January 6, 2018 17:44

  • VSCode Version: 1.20 insiders
  • OS Version: Ubuntu 17.10 + Linux 4.14.12

Steps to Reproduce:

  1. Try to debug a project that used to debug beforehand
  2. Notice that breakpoints set are only listed in the viewlets, the editor does not show red circles in the gutter
  3. Notice that breakpoints no longer hit

Does this issue occur when all extensions are disabled?: cannot test as debugger is an extension

Copied from original issue: microsoft/vscode#41227

Unable to debug with v0.16.0

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.

Unexpected token E. Stopping the debug adapter

From @thomasgarai on May 29, 2016 0:36

  • VSCode Version: 1.1.1
    ====================>
    Commit def9e32467ad6e4f48787d38caf190acbfee5880
    Date 2016-05-13T13:38:00.094Z
    Shell 0.37.6
    Renderer 49.0.2623.75
    Node 5.10.0
  • OS Version: Linux 3.16.0-72-generic [ubuntu 14.0.4 - trusty tahr]
    =============================>

Steps to Reproduce:

  1. prerequisites:
    • install monocomplete
    • install vs code
    • run vs code in project folder [ example console app ]
    • modify launch.json file [ shown below ]
  2. select mono as the active debug configuration
  3. start debugging......
  4. When a breakpoint is hit in code the following error is generated:
    Unexpected token E. Stopping the debug adapter
  5. when vs code is exited the debug process still runs:

visual studio code debug console output:
===============================>
/usr/local/bin/mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55169 --debug ATF.exe

ps -ef yields the following:
====================>
ps -ef | grep mono
tg 14773 2250 0 10:02 ? 00:00:00 /usr/local/bin/mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55169 --debug ATF.exe

netstat -an shows socket still open
===========================>
$ netstat -an | grep 55169
tcp 0 0 127.0.0.1:55169 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:55169 127.0.0.1:44326 CLOSE_WAIT

The launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "mono",
"type": "mono",
"request":"launch",
"program": "${workspaceRoot}/bin/Debug/net40/ubuntu.14.04-x64/ATF.exe",
"runtimeExecutable": "/usr/local/bin/mono",
"runtimeArgs": ["--debug"]
},
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/net40/ubuntu.14.04-x64/ATF.exe",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/net40/ubuntu.14.04-x64/ATF.exe",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": false,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processName": "ATF"
}
]
}

Copied from original issue: microsoft/vscode#7001

Show hex representation of variable while debugging

I work C/C++ code frequently and use VSCode as my primary editor and debugger. Viewing data in hexadecimal representation is necessary when working in low-level development. I'm hoping that it might be possible to configure the debugger, when viewing variables in the left panel and while hovering over the variables in the code editor space, that the hex representation of the variable's value can also be shown. Currently, I can only see the decimal and ASCII representations.

See also: microsoft/vscode#94935

Debugging for custom languages broken

I was debugging my custom .NET language code using this extension (added the extension for the files in the MonoDebugSession white list). In the past this used to work but after updating to the latest insiders build this is no ;longer the case.

"Catch exceptions" checkboxes seem to do nothing

In C#, all exceptions seem to be caught by default. When checking the "All exceptions" checkbox, caught exceptions are not paused on.

I draw the conclusion that these checkboxes do nothing when debugging C#.

We need a mechanism for interrogating the capabilities of a debug adapter. So for node the adapter would return "All exceptions" and "Uncaught exceptions". For mono it would nothing and the UI would show nothing.

Remote debugging

I'm trying to debug remotely with VS Code running on a PC and the code running on a Raspberry Pi.

I got it to work, but in a strange way.

I'm using VS Code 10.11.1 and on the Raspberry Pi I have mono v4.8.1 installed

The RPI has ip-addr: 192.168.0.7.

Here is what I do:

  1. On the rpi: mcs -debug program.cs
  2. On the rpi run: mono --debug --debugger-agent=transport=dt_socket,server=y,address=192.168.7:55555 program.exe and the debugging session spins up.
  3. On the PC: Press F5

When I press F5 I get the error "Unable to open 'program.cs': File not found (\home\pi\share\Test\program.cs)." and the option to "Create the file" or "Cancel".

If I choose cancel, the debug session on the rpi will finalize, but the break point I've set for the debugger will no be hit.

However, if I choose "Create the file" a new empty file will be created in c:\home\pi\share\Test\program.cs on the PC. If I copy in the content of my original program.cs file and save it, the debugging will run, and I will hit the break point as expected.

So, it "works", but is there a way to config this more smoothly? I.e. where the local file c:\home\pi\share\Test\program.cs does not need to be created? I guess that I could just mirror the file structure between the two devices, but that seems "too easy".

Also, is there a way for automatically running step 1) and 2) above on the RPI, every time I press F5?

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/program.exe",
            "args": [],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "",
            "runtimeExecutable": null,
            "env": {},
            "externalConsole": false
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "192.168.0.7",
            "port": 55555
        }
    ]
}

Code:

using System;

namespace Test
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}

There is no changelog for this project

VSCode tells me that this project has updated to version 0.13.0. However, there's no changelog, no reference to this on the page, no new release in Github's release page, and no news anywhere else in the readme. Please consider adding a changelog so that we know what happens in these updates in case there are issues. Thanks!

image

mono.exe not found in debug session

I have Visual Studio Code 1.41.1 installed with latest Mono-debug.
When I start debugging I get the following error:
mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:50046 cscs.exe -d -inmem:0 -co:/debug:pdbonly -ac:2 c:\Users\Administrator\AppData\Roaming\Code\User\cs-script.user\new_script.cs
'"C:\Users\Administrator\AppData\Roaming\Code\User\cs-script.user\mono.exe"' is not recognized as an internal or external command,
operable program or batch file.

When I open a cmd.exe and enter just mono.exe I get the help for mono. So my path variable is correctly set to:
PATH=C:\Program Files\Mono\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
Why does visual studio code try to start mono.exe from the script directory? And why is there a double backslash before mono.exe?

debugger disconnect on embed mono

I embed mono by options:

const char* options[] = {
"--soft-breakpoints",
"--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555,timeout=9999999"
};
mono_jit_parse_options(sizeof(options) / sizeof(char*), (char**)options);

mono_debug_init(MONO_DEBUG_FORMAT_MONO);

mono debug can accept this socket ,but debug thread will get a disconnect event soon, then thread will exit:
res = transport_recv (header, HEADER_LENGTH);

	/* This will break if the socket is closed during shutdown too */
	if (res != HEADER_LENGTH) {
		PRINT_DEBUG_MSG (1, "[dbg] transport_recv () returned %d, expected %d.\n", res, HEADER_LENGTH);

this is the 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": "F:/TProject/Module/CSharpTestMono/bin/Debug/CSharpTestMono.exe",//"${workspaceRoot}/program.exe",
"cwd": "F:/TProject/Module/EmbedMono/x64/Debug"//"${workspaceRoot}"
},
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 55555,
},
]
}

I can debug by Launch,But Attach is not ok now.

Breakpoints not hitting

Breakpoints do not work properly in secondary threads (those created explicitly or from threadpools). In Visual Studio Code, C# projects, execution does indeed pause on breakpoints but the IDE is not notified that it's stopped on a breakpoint. So you can neither move past the breakpoint nor check watches.

Support for ASP.NET (XSP)

Hi, I had trouble debugging an ASP.NET 4.5 web app earlier. Normally Xamarin or VS4Mac would suffice, but I need two debuggers going at once. The VSCode debugger was attaching, and I saw threads in the lower left, but it never paused at my breakpoints. I finally realized that I had disabled debug symbols and that was the reason why the breakpoints weren't being hit. Silly mistake, but I feel more docs are needed for this particular use case.

I figured out how to start my (Nancy) app like this:

$ MONO_OPTIONS="--debug --debugger-agent=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:55555"  xsp4 --address 0.0.0.0 --port 8080 --verbose --root Content/

Strange behaviors I encountered (these might be more to do with mono and/or Nancy framework):

  • Adding ,suspend=n to the debugger options seems like the only way I could make it hit breakpoints.

  • Sometimes it seems to work better if the root is set to the full project folder path.

  • In order for it to actually hit the breakpoints though, I need to hit a route on the app before I attach the debugger. This is the case on both mono 4.6.2 & 4.8.0.

Please let me know if you have any ideas about these issues, or if you need help with docs.

BTW, a month or two ago I forked this project and started a 'mono-xsp' debugger/launcher to try to eliminate the need for setting specific MONO_OPTIONS, but I couldn't figure out how to address/fix these problems. If anyone else sees the need for the launcher, I can forge ahead.

How do you change exception break settings?

I tested by editing the package.json file and changing all the break exception code and it breaks on null reference exception perfectly, but how do i change this setting without editing the plugin's package.json and just the launch.js file?

Cannot set nullable to null in debugger

round.GetType()
{System.Nullable`1[System.Int32]}
round = null
Evaluate request failed (invalid expression).

Suspect that it was from here

if (frame != null) {
if (frame.ValidateExpression(expression)) {
var val = frame.GetExpressionValue(expression, _debuggerSessionOptions.EvaluationOptions);
val.WaitHandle.WaitOne();
var flags = val.Flags;
if (flags.HasFlag(ObjectValueFlags.Error) || flags.HasFlag(ObjectValueFlags.NotSupported)) {
error = val.DisplayValue;
if (error.IndexOf("reference not available in the current evaluation context") > 0) {
error = "not available";
}
}
else if (flags.HasFlag(ObjectValueFlags.Unknown)) {
error = "invalid expression";
}
else if (flags.HasFlag(ObjectValueFlags.Object) && flags.HasFlag(ObjectValueFlags.Namespace)) {
error = "not available";
}
else {
int handle = 0;
if (val.HasChildren) {
handle = _variableHandles.Create(val.GetAllChildren());
}
SendResponse(response, new EvaluateResponseBody(val.DisplayValue, handle));
return;
}
}
else {
error = "invalid expression";
}
}
else {
error = "no active stackframe";
}

Is this a problem of debugger lib repo?

Docker Container Fails to Debug Past V15.8

Hey, I use this extension to debug a docker container running on my local machine and I noticed with the newer version >16.0 that the debugger fails to actually debug when connecting to the container.

Its weird because I can see the threads running in my program so it does "attach" to the instance of mono, but no breakpoints are triggered and the program just runs. Also, if I set my mono debug params to suspend=y it attaches (I can see the main thread appear in Call Stack) but remains suspended and never kicks off the program.

I can still use version 15.8 or less and it works perfectly.

Example mono params in container:
--debug --debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend=y

Mono V5.12 Running in Container:
http://download.mono-project.com/repo/ubuntu/dists/stable-xenial/snapshots/5.12.0.226/

Breakpoints are not hitting while debugging F# console application in VSCode using Mono Debug extension

While trying to debug a f# console application the break points are not hitting, its just launching the application in VSCode debug mode and finishing the execution.

VS Code : 1.10.2
Mono Debug : 0.15.3

launch.json

{
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "C:/FSharp/test/TestFharp/bin/Debug/TestFharp.exe",
            "args": ["Test Arg"],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "",
            "runtimeExecutable": null,
            "env": {},
            "externalConsole":false 
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55555
        }
    ]
}

DEBUG CONSOLE Output:
mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:54579 C:/FSharp/test/TestFharp/bin/Debug/TestFharp.exe "Test Arg"

  • Why is address=127.0.0.1:54579 coming as this even I configured the port as 55555 in launch,json ?
  • Is break points are not hitting because of address mismatch ? How do I make sync these ?

Link to Stack Overflow question : http://stackoverflow.com/questions/42929225/breakpoints-are-not-hitting-while-debugging-f-console-application-in-vscode-usi

Is this project still alive?

Hi @weinand,

This is a great project as far as I could know it. But did it still active? Or this already could be marked as Archived?

During last year I don't find any new commits or releases and project still on pre-release version 0.*

If you don't support it anymore, is any other project which is alive and making the same things?

Debugger is not working

From @wtang3 on November 20, 2015 3:16

Getting error when running app in debug mode.

When hitting play on debugger, debugger options appear for split second and exception occurs.

error while processing request '{_request}' (exception: {_exception})

screen shot 2015-11-19 at 10 09 28 pm

OS: Mac

Copied from original issue: microsoft/vscode#306

Error when trying to debug (f# on mono on OS X)

From @mmc41 on November 20, 2015 18:38

When I try to debug a small hello-world like fsharp 4.0 program like the attached, I get an error "error while processing request '{_request}' (exception: {_exception})" in Visual Code 0.10.1 on OS X 10.10.5 on mono 4.2.1. The associated launch.json file is as follows:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "mono",
"request": "launch",
"program": "hello2.exe",
"args": ["test","test2","bla"],
"cwd": ".",
"runtimeExecutable": null,
"env": {}
},
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 5858
}
]
}

hello2.txt

Copied from original issue: microsoft/vscode#370

Replace debuger-libs binaries by source code

It's few reasons to replace debugger-libs binaries by source code:

  1. debugger-libs classes like SoftDebuggerSession always fail silently, i.e. it just won't work without any exception and logs, so it really hard to understand what is wrong without debugging source code of debuger-libs.
  2. debugger-libs isn't well documented, it doesn't have some kind of tutorials, so I believe that reading source code is the best way to understand how it works.
  3. Owner of Mono.Debugger.Soft, Mono.Debugging and Mono.Debugging.Soft packages is Jetbrains: the release process isn't documented at all (at least I hasn't found any info about it).

Debug output?

Is it already possible to have debug output (using System.Diagnostics.Debug) appear in the "Debug Console" window automatically? Perhaps using a setting such as mono-debug.loggingLevel or so. I suppose one could set this up in the application, but it would be nice to have debug (and possilbly trace) lines appear in a different color.

Attempting to use the debug console to access classes or namespaces results in an "Unknown Identifier" error

When stopped at a breakpoint or exception (or wherever one would typically be able to use the debug console), one is able to use the debug console to make calls and probe around in the current state of the suspended program.

Unfortunately, it would seem that anything outside of the class in which execution was suspended is not accessible. I can access local variables that are in scope, as well. But trying to access anything in another class or namespace results in an unknown identifier error.

image

Cannot pause any thread

If I click pause on one of the threads - only one concrete thread gets paused:
peek 2018-05-17 11-10

mono --version
Mono JIT compiler version 5.12.0.226

How to debug this debugger

I have following config in my launch.json

{
	"type": "mono",
	"request": "launch",
	"name": "Server",
	"program": "${workspaceRoot}/bin/Debug/mono-debug.exe",
	"cwd": "${workspaceRoot}",
	"debugServer": 4711
}

When start debugging with server, I get the this error connect ECONNREFUSED 127.0.0.1:4711
what is the right way to debug this extension

List<string> shows view of raw object in the VS Code watch window

From @spassvogel on August 22, 2018 10:13

I think the formatting of collections in the debug watch window can use a lot of improvement. Compare how visual studio code currently handles a list of String.

image

Whereas in Visual Studio the quick watch feature was much more useful:

image

In general, I am mostly interested in the values in the collection, which I have to dig down four levels of hierarchy in vscode and is quite obfuscated.

Copied from original issue: dotnet/vscode-csharp#2470

Debug in many projects

How i can Debug in many projects? I have self-hosted console application and WebAPI library.So i can debug only in console application, breack point executed in WebAPI, but show nothing

Same variable name in different scopes

Hey, I'm not sure if this is the right place to post this issue. It may be an issue with mono itself. Please close this if it is unrelated to this project.

You can reproduce the issue like so:

public enum TestEnum {
	A, 
	B, 
	C, 
};

{
	TestEnum test = TestEnum.B;
	Debug.LogWarning(test);
}
{
	TestEnum test = TestEnum.C;
	Debug.LogWarning(test);
}

When putting a breakpoint on the second test and reading its value, a value of B will be reported, when the correct value is C.

Debugging with MONO_ENV_OPTIONS

Hi, I want to debug an application which must be launched without mono CLI. Currently I'm doing it by attach i.e. launching the app with MONO_ENV_OPTIONS environment variable set to --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555 and attaching the debugger to it. This configuration works well but frustrates me when I stop debugging as the app needs manual quit after disconnecting.

Is it possible to launch such an app directly upon the debugger?

Unable to set breakpoints "Cannot perform runtime binding on a null reference"

Setting breakpoints is failing using this test program and vscode-mono-debug v0.16.2 and a non-vscode client vimspector

The failure response is:

2020-11-16 21:20:28,333 - DEBUG - Message received: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}

To break down the flow:

  • We start the debug adapter: mono Users/ben/.vim/vimspector-conf/gadgets/macos/vscode-mono-debug/bin/Release/mono-debug.exe
  • Initialise: 2020-11-16 21:20:27,565 - DEBUG - Sending Message: {"command": "initialize", "arguments": {"adapterID": "mono-debug", "clientID": "vimspector", "clientName": "vimspector", "linesStartAt1": true, "columnsStartAt1": true, "locale": "en_GB", "pathFormat": "path", "supportsVariableType": true, "supportsVariablePaging": false, "supportsRunInTerminalRequest": true}, "seq": 0, "type": "request"}
  • Response: 2020-11-16 21:20:28,113 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 0, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': False, 'supportsEvaluateForHovers': False, 'exceptionBreakpointFilters': []}, 'seq': 1, 'type': 'response'}

So far so good.

  • Launch request is sent: 2020-11-16 21:20:28,114 - DEBUG - Sending Message: {"command": "launch", "arguments": {"request": "launch", "program": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.exe", "console": "integratedTerminal", "cwd": "/Users/ben/.vim/bundle/vimspector/support/test/csharp", "args": [], "env": {}, "name": "test"}, "seq": 1, "type": "request"}
  • Initialized event received: 2020-11-16 21:20:28,118 - DEBUG - Message received: {'seq': 2, 'type': 'event', 'event': 'initialized', 'body': None}
  • Breakpoints are sent: 2020-11-16 21:20:28,119 - DEBUG - Sending Message: {"command": "setBreakpoints", "arguments": {"source": {"name": "Program.cs", "path": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.cs"}, "breakpoints": [{"line": 31}]}, "sourceModified": false, "seq": 2, "type": "request"}
  • Exception breakpoints sent to end "breakpoints": 2020-11-16 21:20:28,119 - DEBUG - Sending Message: {"command": "setExceptionBreakpoints", "arguments": {"filters": []}, "seq": 3, "type": "request"}

This is where it starts to go wrong.

First, we receive a duplicate response to the initialize request:

2020-11-16 21:20:28,133 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 0, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': False, 'supportsEvaluateForHovers': False, 'exceptionBreakpointFilters': []}, 'seq': 1, 'type': 'response'}
2020-11-16 21:20:28,133 - INFO - User Msg: Protocol error: duplicate response for request 0

This is bad, but the client just ignores it, so whatever.

  • We then get a runInTerminal request: 2020-11-16 21:20:28,296 - DEBUG - Message received: {'command': 'runInTerminal', 'arguments': {'kind': 'integrated', 'title': 'Node Debug Console', 'cwd': '/Users/ben/.vim/bundle/vimspector/support/test/csharp', 'args': ['mono', '--debug', '--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:57681', 'Program.exe'], 'env': None}, 'seq': 3, 'type': 'request'}

  • And send a response 2020-11-16 21:20:28,309 - DEBUG - Sending Message: {"seq": 4, "type": "response", "request_seq": 3, "command": "runInTerminal", "body": {"processId": 74070}, "success": true}

That's all fine, and we get a response to the launch request:

  • 2020-11-16 21:20:28,310 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 1, 'command': 'launch', 'body': None, 'seq': 4, 'type': 'response'}

But then we get rejections for the breakpoints request from earlier:

  • 2020-11-16 21:20:28,332 - DEBUG - Message received: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}

But then we get a duplicate of that message:

2020-11-16 21:20:28,333 - DEBUG - Message received: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}
2020-11-16 21:20:28,333 - INFO - User Msg: Protocol error: duplicate response for request 2

And finally the exception breakpoints request is accepted: 2020-11-16 21:20:28,336 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 3, 'command': 'setExceptionBreakpoints', 'body': None, 'seq': 6, 'type': 'response'}

Subsequently there are other problems like duplicate responses to the threads request and such, but the inability to set breakpoints seems the most severe.

Full log including DAP trace:

2020-11-16 21:20:23,379 - INFO - **** INITIALISING NEW VIMSPECTOR SESSION ****
2020-11-16 21:20:23,380 - INFO - API is: 
2020-11-16 21:20:23,380 - INFO - VIMSPECTOR_HOME = /Users/ben/.vim/vimspector-conf
2020-11-16 21:20:23,380 - INFO - gadgetDir = /Users/ben/.vim/vimspector-conf/gadgets/macos
2020-11-16 21:20:24,803 - INFO - User requested start debug session with {}
2020-11-16 21:20:24,810 - DEBUG - Reading configurations from: None
2020-11-16 21:20:24,811 - DEBUG - Reading configurations from: /Users/ben/.vim/bundle/vimspector/support/test/csharp/.vimspector.json
2020-11-16 21:20:24,813 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.json
2020-11-16 21:20:24,869 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.d/lldb-vscode.json
2020-11-16 21:20:24,872 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.d/netcoredbg.json
2020-11-16 21:20:24,873 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.d/vim-debug-adapter.json
2020-11-16 21:20:24,875 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.d/vscode-cpptools.json
2020-11-16 21:20:24,877 - DEBUG - Reading gadget config: /Users/ben/.vim/vimspector-conf/gadgets/macos/.gadgets.d/vscode-javac.json
2020-11-16 21:20:24,879 - DEBUG - Reading gadget config: None
2020-11-16 21:20:27,439 - INFO - Configuration: {"adapter": "vscode-mono-debug", "configuration": {"request": "launch", "program": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.exe", "console": "integratedTerminal", "cwd": "/Users/ben/.vim/bundle/vimspector/support/test/csharp", "args": [], "env": {}}}
2020-11-16 21:20:27,440 - INFO - Adapter: {"attach": {"pidSelect": "none"}, "command": ["mono", "/Users/ben/.vim/vimspector-conf/gadgets/macos/vscode-mono-debug/bin/Release/mono-debug.exe"], "name": "mono-debug"}
2020-11-16 21:20:27,552 - INFO - Starting debug adapter with: {"attach": {"pidSelect": "none"}, "command": ["mono", "/Users/ben/.vim/vimspector-conf/gadgets/macos/vscode-mono-debug/bin/Release/mono-debug.exe"], "name": "mono-debug"}
2020-11-16 21:20:27,564 - INFO - Debug Adapter Started
2020-11-16 21:20:27,565 - DEBUG - Sending Message: {"command": "initialize", "arguments": {"adapterID": "mono-debug", "clientID": "vimspector", "clientName": "vimspector", "linesStartAt1": true, "columnsStartAt1": true, "locale": "en_GB", "pathFormat": "path", "supportsVariableType": true, "supportsVariablePaging": false, "supportsRunInTerminalRequest": true}, "seq": 0, "type": "request"}
2020-11-16 21:20:28,113 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 0, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': False, 'supportsEvaluateForHovers': False, 'exceptionBreakpointFilters': []}, 'seq': 1, 'type': 'response'}
2020-11-16 21:20:28,113 - DEBUG - LAUNCH!
2020-11-16 21:20:28,114 - DEBUG - Sending Message: {"command": "launch", "arguments": {"request": "launch", "program": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.exe", "console": "integratedTerminal", "cwd": "/Users/ben/.vim/bundle/vimspector/support/test/csharp", "args": [], "env": {}, "name": "test"}, "seq": 1, "type": "request"}
2020-11-16 21:20:28,118 - DEBUG - Message received: {'seq': 2, 'type': 'event', 'event': 'initialized', 'body': None}
2020-11-16 21:20:28,119 - DEBUG - Sending Message: {"command": "setBreakpoints", "arguments": {"source": {"name": "Program.cs", "path": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.cs"}, "breakpoints": [{"line": 31}]}, "sourceModified": false, "seq": 2, "type": "request"}
2020-11-16 21:20:28,119 - DEBUG - Sending Message: {"command": "setExceptionBreakpoints", "arguments": {"filters": []}, "seq": 3, "type": "request"}
2020-11-16 21:20:28,133 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 0, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': False, 'supportsEvaluateForHovers': False, 'exceptionBreakpointFilters': []}, 'seq': 1, 'type': 'response'}
2020-11-16 21:20:28,133 - INFO - User Msg: Protocol error: duplicate response for request 0
2020-11-16 21:20:28,134 - ERROR - Duplicate response: {'success': True, 'message': None, 'request_seq': 0, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': False, 'supportsEvaluateForHovers': False, 'exceptionBreakpointFilters': []}, 'seq': 1, 'type': 'response'}
Traceback (most recent call last):
  File "/Users/ben/.vim/bundle/vimspector/python3/vimspector/debug_adapter_connection.py", line 245, in _OnMessageReceived
    request = self._outstanding_requests.pop( message[ 'request_seq' ] )
KeyError: 0
2020-11-16 21:20:28,296 - DEBUG - Message received: {'command': 'runInTerminal', 'arguments': {'kind': 'integrated', 'title': 'Node Debug Console', 'cwd': '/Users/ben/.vim/bundle/vimspector/support/test/csharp', 'args': ['mono', '--debug', '--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:57681', 'Program.exe'], 'env': None}, 'seq': 3, 'type': 'request'}
2020-11-16 21:20:28,309 - DEBUG - Sending Message: {"seq": 4, "type": "response", "request_seq": 3, "command": "runInTerminal", "body": {"processId": 74070}, "success": true}
2020-11-16 21:20:28,310 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 1, 'command': 'launch', 'body': None, 'seq': 4, 'type': 'response'}
2020-11-16 21:20:28,332 - DEBUG - Message received: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}
2020-11-16 21:20:28,332 - ERROR - Request failed: error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)
2020-11-16 21:20:28,332 - WARNING - User Msg: Unable to set breakpoint: error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)
2020-11-16 21:20:28,333 - DEBUG - Message received: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}
2020-11-16 21:20:28,333 - INFO - User Msg: Protocol error: duplicate response for request 2
2020-11-16 21:20:28,333 - ERROR - Duplicate response: {'success': False, 'message': "error while processing request 'setBreakpoints' (exception: Cannot perform runtime binding on a null reference)", 'request_seq': 2, 'command': 'setBreakpoints', 'body': {'error': {'id': 1104, 'format': "error while processing request '{_request}' (exception: {_exception})", 'variables': {'_request': 'setBreakpoints', '_exception': 'Cannot perform runtime binding on a null reference'}, 'showUser': True, 'sendTelemetry': False}}, 'seq': 5, 'type': 'response'}
Traceback (most recent call last):
  File "/Users/ben/.vim/bundle/vimspector/python3/vimspector/debug_adapter_connection.py", line 245, in _OnMessageReceived
    request = self._outstanding_requests.pop( message[ 'request_seq' ] )
KeyError: 2
2020-11-16 21:20:28,336 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 3, 'command': 'setExceptionBreakpoints', 'body': None, 'seq': 6, 'type': 'response'}
2020-11-16 21:20:28,336 - DEBUG - Sending Message: {"command": "threads", "seq": 5, "type": "request"}
2020-11-16 21:20:28,336 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 3, 'command': 'setExceptionBreakpoints', 'body': None, 'seq': 6, 'type': 'response'}
2020-11-16 21:20:28,336 - INFO - User Msg: Protocol error: duplicate response for request 3
2020-11-16 21:20:28,336 - ERROR - Duplicate response: {'success': True, 'message': None, 'request_seq': 3, 'command': 'setExceptionBreakpoints', 'body': None, 'seq': 6, 'type': 'response'}
Traceback (most recent call last):
  File "/Users/ben/.vim/bundle/vimspector/python3/vimspector/debug_adapter_connection.py", line 245, in _OnMessageReceived
    request = self._outstanding_requests.pop( message[ 'request_seq' ] )
KeyError: 3
2020-11-16 21:20:28,341 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 1, 'command': 'launch', 'body': None, 'seq': 4, 'type': 'response'}
2020-11-16 21:20:28,341 - INFO - User Msg: Protocol error: duplicate response for request 1
2020-11-16 21:20:28,341 - ERROR - Duplicate response: {'success': True, 'message': None, 'request_seq': 1, 'command': 'launch', 'body': None, 'seq': 4, 'type': 'response'}
Traceback (most recent call last):
  File "/Users/ben/.vim/bundle/vimspector/python3/vimspector/debug_adapter_connection.py", line 245, in _OnMessageReceived
    request = self._outstanding_requests.pop( message[ 'request_seq' ] )
KeyError: 1
2020-11-16 21:20:28,350 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 5, 'command': 'threads', 'body': {'threads': []}, 'seq': 7, 'type': 'response'}
2020-11-16 21:20:28,350 - WARNING - User Msg: Server returned no threads. Is it running?
2020-11-16 21:20:28,350 - DEBUG - Message received: {'success': True, 'message': None, 'request_seq': 5, 'command': 'threads', 'body': {'threads': []}, 'seq': 7, 'type': 'response'}
2020-11-16 21:20:28,350 - INFO - User Msg: Protocol error: duplicate response for request 5
2020-11-16 21:20:28,352 - ERROR - Duplicate response: {'success': True, 'message': None, 'request_seq': 5, 'command': 'threads', 'body': {'threads': []}, 'seq': 7, 'type': 'response'}
Traceback (most recent call last):
  File "/Users/ben/.vim/bundle/vimspector/python3/vimspector/debug_adapter_connection.py", line 245, in _OnMessageReceived
    request = self._outstanding_requests.pop( message[ 'request_seq' ] )
KeyError: 5
2020-11-16 21:20:28,499 - DEBUG - Message received: {'seq': 8, 'type': 'event', 'event': 'terminated', 'body': None}
2020-11-16 21:20:28,499 - INFO - User Msg: Debugging was terminated by the server.

'All Exceptions' and 'Uncaught Exceptions' options disappear (C# - Mac)

Using VS Code and vscode-mono-debug on a macOS 10.12 for a C# project. When the project is started, the debug panel briefly lists 'All Exceptions' and 'Uncaught Exceptions' options. But these disappear moments later when the debugger attaches to the xsp process.

screen shot 2017-11-07 at 11 29 41 am

screen shot 2017-11-07 at 11 28 39 am

The scripts/configurations which we use for starting the debugger are attached:

Debug scripts.zip

project/launch.js
project/startServer.sh
project/.vscode/launch.json

Can't launch debug (sh: 1 [: Linux: unexpected operator)

This appears to be a regression, and someone filed an issue on the main VS Code repo, and the developer just closed it and asked them to file it here. I don't think they did, so:

Platform
4.15.0-33-generic #36~16.04.1-Ubuntu SMP (x64)

Build info
Version: 1.26.1
Commit: 493869ee8e8a846b0855873886fc79d480d342de
Date: 2018-08-16T18:34:20.517Z
Electron: 2.0.5
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Remote Debug",
            "type": "cppdbg",
            "request": "attach",
            "program": "/usr/src/build/bin/qd",
            "processId": "${command:pickRemoteProcess}",
            "targetArchitecture": "arm",
            "pipeTransport": {
                "debuggerPath": "/usr/bin/gdb",
                "pipeProgram": "/usr/bin/ssh",
                "pipeArgs": ["root@tom"],
                "pipeCwd":"${workspaceFolder}"
            },
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

Resulting output (says remote-attach)

Linux
sh: 1: [: Linux: unexpected operator
sh: 1: [: Linux: unexpected operator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.