From 1be9c35c940e9a1edbb44a0e7dd51b48529ffb9b Mon Sep 17 00:00:00 2001 From: Roland Senn Date: Thu, 3 Oct 2019 16:37:52 +0200 Subject: Fix #14690 - :steplocal panics after break-on-error `:steplocal` enables only breakpoints in the current top-level binding. When a normal breakpoint is hit, then the module name and the break id from the `BRK_FUN` byte code allow us to access the corresponding entry in a ModBreak table. From this entry we then get the SrcSpan (see compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint). With this source-span we can then determine the current top-level binding, needed for the steplocal command. However, if we break at an exception or at an error, we don't have an BRK_FUN byte-code, so we don't have any source information. The function `bindLocalsAtBreakpoint` creates an `UnhelpfulSpan`, which doesn't allow us to determine the current top-level binding. To avoid a `panic`, we have to check for `UnhelpfulSpan` in the function `ghc/GHCi/UI.hs:stepLocalCmd`. Hence a :steplocal command after a break-on-exception or a break-on-error is not possible. --- docs/users_guide/ghci.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index 72e2d66e12..d1229ed0d5 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -2884,7 +2884,10 @@ commonly used commands. .. ghci-cmd:: :steplocal Enable only breakpoints in the current top-level binding and resume - evaluation at the last breakpoint. + evaluation at the last breakpoint. Continuation with + :ghci-cmd:`:steplocal` is not possible if this last breakpoint was + hit by an error (:ghc-flag:`-fbreak-on-error`) or an + exception (:ghc-flag:`-fbreak-on-exception`). .. ghci-cmd:: :stepmodule -- cgit v1.2.1