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

Add debug flag to get stack traces on mono #565

Closed
wants to merge 2 commits into from

Conversation

baronfel
Copy link
Contributor

if you add --debug then your stack traces have line numbers, yay!

@baronfel
Copy link
Contributor Author

baronfel commented Sep 28, 2017

helps with stacktraces like this:

Failed parsing project file: /Users/chet/code/oss/SwaggerProvider/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj: Microsoft.Build.Exceptions.InvalidProjectFileException: 
/Users/chet/code/oss/SwaggerProvider/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj: 
Object reference not set to an instance of an object at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectCrackerTool+FSharpProjectFileInfo..ctor (System.String fsprojFileName, Microsoft.FSharp.Core.FSharpOption`1[T] properties, Microsoft.FSharp.Core.FSharpOption`1[T] enableLogging) [0x00129] in <599f46db06d737baa7450383db469f59>:0 at
Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectCrackerTool.getOptions@387 (System.Boolean enableLogging, Microsoft.FSharp.Collections.FSharpList`1[T] properties, System.String file) [0x0000f] in <599f46db06d737baa7450383db469f59>:0 at
Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectCrackerTool.getOptions (System.String file, System.Boolean enableLogging, Microsoft.FSharp.Collections.FSharpList`1[T] properties) [0x00005] in <599f46db06d737baa7450383db469f59>:0 at 
Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.ProjectCrackerTool.crackOpen (System.String[] argv) [0x000cc] in <599f46db06d737baa7450383db469f59>:0

@Krzysztof-Cieslak
Copy link
Member

CC: @enricosada

Will it have impact on anything else?

@baronfel
Copy link
Contributor Author

The mono docs mention that it does have an impact on performance to run with debug information enabled, but i think it's a small price to pay to get mono users on parity with Windows users. Windows stacktraces are always enabled, lucky ducks

@enricosada
Copy link
Contributor

no clue, sry.

@nosami @mrward feedback on this?

@nosami
Copy link

nosami commented Oct 4, 2017

Not sure what that --debug flag is doing. Does it pass it through to Mono?

All that is needed for better stack traces is either .mdb files or portable pdb files next to the executables / libraries. On Mono, old style Windows pdb files don't work and you get these 0 line numbers.

Makes no difference if the exe is compiled as Release or Debug.

@nosami
Copy link

nosami commented Oct 4, 2017

Looks like the issue here is that ProjectCrackerTool is using the Windows pdb file format.

@baronfel
Copy link
Contributor Author

baronfel commented Oct 4, 2017

ah geez, I am dumb. I put the --debug flag on fsac invocation, not on mono invocation. I've fixed that.

@nosami this is specifically around stack traces for FSAC. So if we bundled .mdb and/or portable pdbs in the Ionide extension directory here, we'd get better traces for FSAC itself?

chet@Chet-MacBook ~/.vscode/extensions/Ionide.ionide-fsharp-3.3.3/bin
$ ll                                                                                                                                                                                                                              [9:30:04]
total 43192
-rw-r--r--  1 chet  staff   293K Oct  3 10:20 Argu.dll
-rw-r--r--  1 chet  staff    61K Oct  3 10:20 Dotnet.ProjInfo.dll
-rw-r--r--  1 chet  staff   238K Oct  3 10:20 FParsec.dll
-rw-r--r--  1 chet  staff   117K Oct  3 10:20 FParsecCS.dll
-rw-r--r--  1 chet  staff    17K Oct  3 10:20 FSharp.Compiler.Service.ProjectCracker.dll
-rw-r--r--  1 chet  staff   1.5M Oct  3 10:20 FSharp.Compiler.Service.ProjectCrackerTool.exe
-rw-r--r--  1 chet  staff   1.0K Oct  3 10:20 FSharp.Compiler.Service.ProjectCrackerTool.exe.config
-rw-r--r--  1 chet  staff    14M Oct  3 10:20 FSharp.Compiler.Service.dll
-rw-r--r--  1 chet  staff   1.4M Oct  3 10:20 FSharp.Core.dll
-rw-r--r--  1 chet  staff   617K Oct  3 10:20 FSharpLint.Core.dll
-rw-r--r--  1 chet  staff   902K Oct  3 10:20 FsAutoComplete.Core.dll
-rw-r--r--  1 chet  staff   639K Oct  3 10:20 Newtonsoft.Json.dll
-rw-r--r--  1 chet  staff    59K Oct  3 10:20 Sln.dll
-rw-r--r--  1 chet  staff   813K Oct  3 10:20 Suave.dll
-rw-r--r--  1 chet  staff   239K Oct  3 10:20 System.Collections.Immutable.dll
-rw-r--r--  1 chet  staff   454K Oct  3 10:20 System.Reflection.Metadata.dll
-rw-r--r--  1 chet  staff   140K Oct  3 10:20 fsautocomplete.exe
-rw-r--r--  1 chet  staff   560B Oct  3 10:20 fsautocomplete.exe.config

@nosami
Copy link

nosami commented Oct 4, 2017

@nosami this is specifically around stack traces for FSAC. So if we bundled .mdb and/or portable pdbs in the Ionide extension directory here, we'd get better traces for FSAC itself?

yep! You need an .mdb or .pdb file (but only portable works) for each exe and dll. The problem here is that most library authors use Windows and package the non portable version of pdb inside the NuGets.

Hopefully, portable pdb adoption will become the norm as it works cross platform.

@Krzysztof-Cieslak
Copy link
Member

I think we can handle it as part - ionide/FsAutoComplete#224. When we will move FSAC to SDK based project files we will be able to generate portable pdbs easily. Then we could distribute them with Ionide without any problem.

CC: @enricosada

@baronfel
Copy link
Contributor Author

baronfel commented Oct 4, 2017

I was just going to suggest that, @Krzysztof-Cieslak. I'm ok with closing this issue in light of that :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants