Hi Andy,

We have a long-standing todo to emit debug symbols from FSI. This is why line numbers are not being shown. It also enable other interesting scenarios like launching the VS debugger at exceptions within generated code.

For the second point you want the prefedined --defines COMPILED and INTERACTIVE.

Regards

don

By on 6/7/2007 4:40 PM ()

I tried generating an exception from fsharpi while running with --debug:full and receive no line numbers.

May I presume that, seven years later, this long-standing todo is still long-standing?

By on 7/28/2014 7:43 AM ()

F# Interactive emits debug symbols.

(a) To get line information in exceptions, you have to be loading from a file, like "fsi foo.fsx" or a #load, or else #line directives must be emitted by the script or tool hosting F# Interactive. The #line directives are inserted autoatically by Visual Studio and Xamarin Studio.

(b) Line information seem to be missing for exceptions from top-level initialization code.

(c) inlining and optimization may affect the accuracy of line information

Example:

#line 3 @"abc.fs"

let f() =
printfn "hello"
printfn "hello"
printfn "hello"
printfn "hello"
printfn "hello"
(failwith "x" : int)

f()

System.Exception: x
at FSI_0004.f() in C:\test\abc.fs:line 9
at <StartupCode$FSI_0004>.$FSI_0004.main@()

Note the "line 9" on the second last line

By on 7/28/2014 8:16 AM ()

Thanks Don.

I've been making more and more use of fsi - it's such a cool tool. Debug info - at least for command line files (not sure how it would work for manually entered code to be honest) would be great.

Re. second point - I figured you'd already have something like this. Thanks for the head's up.

Cheers,

Andy

By on 6/9/2007 4:59 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper