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

Debugger.Launch not working on MacOS #41029

Closed
thepalbi opened this issue Aug 19, 2020 · 4 comments
Closed

Debugger.Launch not working on MacOS #41029

thepalbi opened this issue Aug 19, 2020 · 4 comments
Labels
area-Diagnostics-coreclr untriaged New issue has not been triaged by the area owner

Comments

@thepalbi
Copy link

Description

A few days ago, while playing around with Coyote I find out there was an issue while using a command that supposedly launches a debugger, and wait until you attach it to continue execution. This feature is not working in MacOS, but they suggested trying adding a

Debugger.Launch()

to trigger the debugging. This is also not working in MacOS (when running a program directly from the CLI). However, I'm able to debug from VS. Also checked, and the call to Debugger.Launch is returning true, as if it executed correctly.

Is it possible there's no support for this use-case in MacOS?

Also tried this small program:

namespace Microsoft.Coyote.Samples.HelloWorldTasks
{
    public static class Program
    {
        public static void Main()
        {
            bool debuggerLaunchSuccessful = Debugger.Launch();
            if (!debuggerLaunchSuccessful)
            {
                Console.WriteLine("Debugger launch not successful 😐");
            }

            Console.WriteLine("Program finished correctly");
        }
    }
}

And still getting not the expected behavior. Tried both with dotnet run, and building a standalone.

Configuration

➜  HelloWorldTasks git:(master) ✗ dotnet --version
3.1.401
  • MacOS 10.15.5

Regression?

Other information

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Diagnostics-coreclr untriaged New issue has not been triaged by the area owner labels Aug 19, 2020
@ghost
Copy link

ghost commented Aug 19, 2020

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@thepalbi thepalbi changed the title Debugger.Launch not working on MacOs Debugger.Launch not working on MacOS Aug 19, 2020
@svick
Copy link
Contributor

svick commented Aug 19, 2020

If I'm following the code right, Debugger.Launch() on Unix ends up here:

#else // !TARGET_UNIX
return E_ABORT;
#endif // !TARGET_UNIX

I.e. it does nothing, it only fails.

Debugger.Launch() returns true, because it almost always does, even in the case of a failure:

if (!IsDebuggerPresent())
{
LOG((LF_CORDB, LL_ERROR, "D::LDFU: Failed to launch the debugger.\n"));
}
return S_OK;

@thepalbi
Copy link
Author

Thanks for the clarification. Left a note that this is not supported on Linux or MacOS, and ended up debugging by creating a custom Run Configuration on VS.

danmoseley added a commit to dotnet/dotnet-api-docs that referenced this issue Aug 19, 2020
@danmoseley
Copy link
Member

@thepalbi you can click the pencil in the top right of the documentation topic to fix stuff like this -- I did it in this case.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Diagnostics-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants