GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use mono source for debugger-libs by jonathanpeppers · Pull Request #64 · microsoft/vscode-mono-debug

Conversation

@jonathanpeppers

@jonathanpeppers Jonathan Peppers (jonathanpeppers) commented Jul 10, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I was attempting to use this extension to debug a Xamarin.Android
application. It "sort of" works, except the locals render in an odd
way, such as:

Local
    arg0: 0xfffffffff0b76140
    arg1: 0xffffffffffff894c
    arg2: 0x0

I think the issue is just that the Mono debugger libraries are old and
out of date.

The NuGet packages being used for the Mono debugger are unlisted and
unmaintained, such as:

https://www.nuget.org/packages/Mono.Debugging/1.0.20161020.46

Within Xamarin, most projects add a git submodule for
mono/debugger-libs and xamarin/nrefactory and build these libraries
from source. This allowed me to remove NuGet packages and use
@(ProjectReference) instead.

I also had to update $(TargetFrameworkVersion) to v4.7.2.

After doing this, I updated some other NuGet packages so their versions
matched what debugger-libs is using:

  • Mono.Cecil 0.10.1
  • Newtonsoft.Json 10.0.3

Now I can see proper locals in a Xamarin.Android app!

image

Using a launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 10000,
            "preLaunchTask": "Debug",
        }
    ]
}

And a tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Debug",
            "type": "shell",
            "command": "msbuild HelloAndroid/HelloAndroid.csproj -t:Install,_Run -p:AndroidAttachDebugger=true"
        },
    ]
}

I will setup a .NET 6 example in this repo down the road:

https://github.com/xamarin/net6-samples

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jonathanpeppers
Jonathan Peppers (jonathanpeppers) force-pushed the mono-debugger-libs branch from 6b784cc to 9d83781 Compare July 10, 2020 21:59
@jonathanpeppers
Use mono source for debugger-libs
08694c2
I was attempting to use this extension to debug a Xamarin.Android
application. It "sort of" works, except the locals render in an odd
way, such as:

    Local
        arg0: 0xfffffffff0b76140
        arg1: 0xffffffffffff894c
        arg2: 0x0

I think the issue is just that the Mono debugger libraries are old and
out of date.

The NuGet packages being used for the Mono debugger are unlisted and
unmaintained, such as:

https://www.nuget.org/packages/Mono.Debugging/1.0.20161020.46

Within Xamarin, most projects add a `git submodule` for
mono/debugger-libs and xamarin/nrefactory and build these libraries
from source. This allowed me to remove NuGet packages and use
`@(ProjectReference)` instead.

I also had to update `$(TargetFrameworkVersion)` to `v4.7.2`.

After doing this, I updated some other NuGet packages so their versions
matched what `debugger-libs` is using:

* Mono.Cecil 0.10.1
* Newtonsoft.Json 10.0.3

Now I can see proper locals in a Xamarin.Android app!

Using a `launch.json`:

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Debug",
                "type": "mono",
                "request": "attach",
                "address": "localhost",
                "port": 10000,
                "preLaunchTask": "Debug",
            }
        ]
    }

And a `tasks.json`:

    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "Debug",
                "type": "shell",
                "command": "msbuild HelloAndroid/HelloAndroid.csproj -t:Install,_Run -p:AndroidAttachDebugger=true"
            },
        ]
    }

I will setup a .NET 6 example in this repo down the road:

https://github.com/xamarin/net6-samples
@jonathanpeppers
Jonathan Peppers (jonathanpeppers) force-pushed the mono-debugger-libs branch from 9d83781 to 08694c2 Compare July 10, 2020 21:59
@jonathanpeppers
Fix TypeScript error
7ccb1c8
Fixes:

    src/typescript/tests/adapter.test.ts:91:38 - error TS2559: Type '10' has no properties in common with type '{ path?: string | RegExp; line?: number; column?: number; }'.
@jonathanpeppers

Jonathan Peppers (jonathanpeppers) commented Jul 10, 2020

Copy link
Copy Markdown
Member Author

I was seeing this build error locally as well:

src/typescript/tests/adapter.test.ts:91:38 - error TS2559: Type '10' has no properties in common with type '{ path?: string | RegExp; line?: number; column?: number; }'.

I think I did the right thing to fix it, I don't know much about TypeScript, though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonathanpeppers
Fix failing test
a85319f
In the generated file, `Debugger.Break()` is actually on line 11:

    using System;
    using System.Diagnostics;

    namespace Tests
    {
        class Simple {

            public static void Main(string[] args) {

                if (System.Diagnostics.Debugger.IsAttached) {
                    Debugger.Break();
                }

                Console.WriteLine("Hello World!");

                Console.WriteLine("The End.");
            }
        }
    }
@jonathanpeppers

Jonathan Peppers (jonathanpeppers) commented Jul 15, 2020

Copy link
Copy Markdown
Member Author

Alexander Köplinger (@akoeplinger) are you able to review or merge this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akoeplinger
Alexander Köplinger (akoeplinger) approved these changes Jul 20, 2020
View reviewed changes
@akoeplinger
Alexander Köplinger (akoeplinger) merged commit 13c64be into microsoft:master Jul 20, 2020
@jonathanpeppers
Jonathan Peppers (jonathanpeppers) deleted the mono-debugger-libs branch July 20, 2020 13:26
@akoeplinger Alexander Köplinger (akoeplinger) mentioned this pull request Oct 7, 2020
Replace debuger-libs binaries by source code #36
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@akoeplinger Alexander Köplinger (akoeplinger) akoeplinger approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jonathanpeppers @akoeplinger
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.