fsharp
fsharp copied to clipboard
`Tracking:` Compiler debuggability improvements
During a compiler debugging session with @dsyme, we've identified a few points which need improvements:
-
reqdTy
(mayTType
instances) is showed assolved
with no information, show solution when possible (possibly, show solution depth). -
NOTE:
range
'sToString
will go to the filesystem and read the file. We can also reduce the text (10 characters?) -
Debugger is slow expanding object with bunch of properties (for example
TType
). -
Search codebase for
ToString
, have them consistent (having a simple string representing the type). -
Putting
.ToString()
with simpler info, consistently across types, rather than type name to:- TyparFlags
- XmlDoc
- CallerArg
- CalledArg
- AssignedCalledArg
- cenv, TcEnv (inconsistent ToString()), TcGlobals, TcImports, TcState
- DispayEnv, NameResolutionEnv should deliver a simple string, instead of
%A
- AccessorDomain, AccessibleFrom, CompPath - simpler ToString().
- ... review types of
MethodCalls.fs
. - Review all of
Syn*
types. - Review test framework
ToString
s (e.g. CompilationSource and CompilationUnit).
-
Consider putting
DebuggerStepThrough
(helps debugging experience by not stepping into functions/methods),DebuggerHidden
(hide stack frames) orDebuggerNonUserCode
.- We need to review current compiler stacktraces and remove higher-order functions, for example:
-
DiagnosticLogger.fs
-TryD
,MapD
,MapD.loop
,MapCombineTDC2D
,MapCombineTDCD
StackGuard.Guard
and others. -
ConstraintSolver
-CollectThenUndoOrCommit
-
- We need to review current compiler stacktraces and remove higher-order functions, for example:
-
Consider adding
NonUserCode
to the library functions (likemap
,fold
, etc.)? This may complicate debuggingFSharp.Core
itself. -
Consider using
DebuggerHidden
and/orNonUserCode
onStartWithContinuationsUsingDispatchInfo
,StartWithContinuations
andStartImmediate
. -
Make
_FullList
null if the length is<= ListDebugViewMaxLength
:[<DebuggerBrowsable(DebuggerBrowsableState.Collapsed)>] member x._FullList = items (count l 0 ListDebugViewMaxFullLength)
NOTE: range's ToString will go to the filesystem and read the file. We can also reduce the text (10 characters?)
It can be very handy when debugging something parser-related, please leave a least some way to keep it like this.
It can be very handy when debugging something parser-related, please leave a least some way to keep it like this.
You we should add a debug property with full text