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 f# on .net core #1257

Closed
enricosada opened this issue Feb 21, 2017 · 17 comments
Closed

Debugging f# on .net core #1257

enricosada opened this issue Feb 21, 2017 · 17 comments
Labels

Comments

@enricosada
Copy link

enricosada commented Feb 21, 2017

ref ionide/ionide-vscode-fsharp#366

I'd like to support debugging of .net core f# apps. That app will generate portable pdb, and is built with latest released f# .net core compiler (fsc)

Doing some tests, it works sort of,

image

Repro:

launch.fs is the one generated by omnisharp

What works?

  • stop on exception
  • eval/locals (c# style)
  • breakpoints require dev version of ionide
  • nested functions (need a new repro, but just extract failwith in a function) require dev version of ionide

What doesnt work

  • eval f# style

Some guidance from debugger team on how add debugger breakpoints? It's something the vs extension ionide https://github.com/ionide/ionide-vscode-fsharp should do?

Thanks to @DustinCampbell @filipw for help.

/cc @KevinRansom @cartermp @Krzysztof-Cieslak

Environment data

dotnet --info output: 1.0.0-rc4-004771
VS Code version: 1.9.1
C# Extension version: 1.7.0
F# Ionide Extension version: 2.22.3

@DustinCampbell
Copy link
Member

cc @gregg-miskelly

@enricosada
Copy link
Author

some info about portablepdb and breakpoint from @filipw : dotnet/roslyn#16489 (comment) to not lose it :D

@enricosada
Copy link
Author

Some progress thanks to @Krzysztof-Cieslak

If i add mono-debugger extension, breakpoint magically start to work for .net core debugger too.
Checking source code, mono-debugger enable breakpoints checking the filename extension

So where is the code who does that for c# in .net core debugger? a similar fix maybe is enough.

@enricosada
Copy link
Author

related, also unity debugger work like mono-debugger but doesnt enable f# extensions

@enricosada
Copy link
Author

enricosada commented Feb 22, 2017

More progress. breakpoints works, steps too

debug-breakpoints

Added to package.json to enable breakpoints

     "breakpoints": [
        {
          "language": "fsharp"
        }
      ]

But review/feedback from debugger team will be nice to have

@gregg-miskelly
Copy link
Contributor

@enricosada that sounds correct that you would add 'fsharp' under breakpoint languages in package.json.

@gregg-miskelly
Copy link
Contributor

@enricosada does this issue track anything else, or should I close it?

@gregg-miskelly
Copy link
Contributor

@enricosada I am closing this for now. But feel free to ping back and/or open a new issue if there is more that we can try and help with.

@enricosada
Copy link
Author

Thank @gregg-miskelly i think can be closed too, sry for late reply. Debugging will works ok with f#.

I didnt had the opportunity to reach the debugger team yet (i have no points of contact atm because i dont know who they are) to have come clarification about how to improve things (like eval), etc. will try other ways (suggestion welcome :D)

But is ok :D, thx for help!

@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Mar 7, 2017

@enricosada the debugger team is my team. You can open issues here and we will see them.

For supporting F# expressions - someone would need to develop an F# expression evaluator. There is a sample expression evaluator on https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Managed-Expression-Evaluator-Sample. It used to be really hard to make a good EE, so the F# team and community never tried to make one (to my knowledge at least). It is certainly not something that someone is going to bang out in a week, but it is way easier than it used to be, so it would be great if someone from the team or community took that on. We are happy to provide some assistance in getting started / when folks get stuck. But it isn't something we have the resources or F# expertise to implement ourselves. Our model is that we provide the language-neutral infrastructure and language teams write the language-specific portions.

@enricosada
Copy link
Author

Sorry Gregg, i confused your reply because in this repo.
I also didnt check the teams list on dotnet org (but that is visibile only if logged, uops two times)
So my bad.

Our model is that we provide the language-neutral infrastructure and language teams write the language-specific portions

Perfect for me, i like that. if is language neutral by default, is easier to add other langs like f#. When is c# first and extensibility is added instead is a pain (just an example the lang, is valid for all extensible tools)

We are happy to provide some assistance in getting started / when folks get stuck. But it isn't something we have the resources or F# expertise to implement ourselves

I think that's enough, can be done by F# community, just need a bit of guidance/pointers at start. and the repo you linked is a really good start. The real hard part is to find info to start 😄

@enricosada
Copy link
Author

@gregg-miskelly added dotnet/fsharp#2544 to track f# evaluator, if someone in community want to try implement that. Thx a lot another time!

@enricosada
Copy link
Author

@gregg-miskelly @DustinCampbell as a note, thx a lot for support.

now F# works ootb (ionide obv) with dotnet new -> dotnet restore -> intellisense! -> F5 -> debug!

with packagererences, projectreferences etc 😄

recf-ionide2

@DustinCampbell
Copy link
Member

Very nice! cc @cartermp

@gregg-miskelly
Copy link
Contributor

@enricosada Very cool!

@cartermp
Copy link

Huge work @enricosada!

@rubberduck203
Copy link

If anyone finds themselves here wondering why you keep getting errors while trying to debug, make sure you pay attention to the error message. I had to download the .Net Core debugger to get this to work.

Ctrl + P to open the command palette then type

> Debug: Download Download .NET Core Debugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants