【发布时间】:2020-07-06 02:29:55
【问题描述】:
我正在查看 F# 中生成的堆栈跟踪,它们正在跳过函数。一个测试用例:
let foo() =
failwithf "foo"
[<EntryPoint>]
let main argv =
foo()
0
使用调试信息编译,然后运行:
(torch) C:\t>fsc -g test.fs
Microsoft (R) F# Compiler version 10.8.0.0 for F# 4.7
Copyright (c) Microsoft Corporation. All Rights Reserved.
(torch) C:\t>test
Unhandled Exception: System.Exception: foo
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message)
at Test.main(String[] argv) in C:\t\test.fs:line 7
它说异常是从main 生成的,但没有提到它实际生成的位置foo。
如何获取完整的堆栈跟踪,包括实际生成异常的函数?
【问题讨论】:
标签: .net debugging exception f# stack-trace