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

Debugging with mono and building with xbuild breaks debugging! #29

Open
weinand opened this issue Apr 18, 2017 · 3 comments
Open

Debugging with mono and building with xbuild breaks debugging! #29

weinand opened this issue Apr 18, 2017 · 3 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@weinand
Copy link
Contributor

weinand commented Apr 18, 2017

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

@weinand
Copy link
Contributor Author

weinand commented Apr 18, 2017

@chncy What version of mono-debug are you using?
If you are not using the latest (0.15.5), please upgrade and try with the latest.

@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Apr 18, 2017
@chncy
Copy link

chncy commented Apr 18, 2017

@weinand I am using the latest update, i updated it from vscode directly

@DanOlivier
Copy link

I have this too, kind of. Running Ubuntu 17.04.
Everything works (i.e. breakpoints are hit and call stack looks accurate), except that not all variables are available/visible, but I don't yet see the pattern.

VSCode Version:

Version 1.16.1
Commit 27492b6bf3acb0775d82d2f87b25a93490673c6d
Date 2017-09-14T16:26:20.018Z
Shell 1.7.3
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

OS, mono, xbuild:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty

$ mono -V
Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

$ xbuild /version
XBuild Engine Version 14.0
Mono, Version 4.6.2.0
Copyright (C) 2005-2013 Various Mono authors

These are some of the dependencies I'm installing:

  • mono-xbuild
  • mono-dmcs
  • libmono-microsoft-build-tasks-v4.0-4.0-cil
  • libmono-system-data-datasetextensions4.0-cil
  • libmono-system-web-extensions4.0-cil
  • libmono-system-management4.0-cil
  • libmono-system-xml-linq4.0-cil
  • libmono-corlib4.5-cil
  • libmono-windowsbase4.0-cil
  • libmono-system-io-compression4.0-cil
  • libmono-system-io-compression-filesystem4.0-cil
  • libmono-system-runtime4.0-cil
  • mono-devel
  • clang-3.9
  • build-essential

DotNet also installed, using these steps:

url https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-zesty-prod zesty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install dotnet-sdk-2.0.0

Compilation step:

$ xbuild MyProject.csproj /property:Configuration="Debug" /verbosity:quiet /nologo

Note: here is the relevant configuration in the csproj file:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>..\..\..\Binaries\DotNET\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <Optimize>false</Optimize>
    <DebugType>full</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>

Contents of 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": "MyProject",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/Engine/Binaries/DotNET/MyProject.exe",
            "args": [ "-verbose" ],
            "cwd": "${workspaceRoot}",
            "stopAtEntry": true,
            "console": "internalConsole"
        }
    ]
}

@weinand weinand removed their assignment Oct 20, 2021
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