diff options
Diffstat (limited to 'compiler/GHC/Utils/Panic.hs')
-rw-r--r-- | compiler/GHC/Utils/Panic.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/Utils/Panic.hs b/compiler/GHC/Utils/Panic.hs index 04e94b81d4..398a97524c 100644 --- a/compiler/GHC/Utils/Panic.hs +++ b/compiler/GHC/Utils/Panic.hs @@ -34,6 +34,7 @@ module GHC.Utils.Panic , cmdLineError , cmdLineErrorIO , callStackDoc + , prettyCallStackDoc , Exception.Exception(..) , showException @@ -289,9 +290,12 @@ withSignalHandlers act = do act `MC.finally` mayUninstallHandlers callStackDoc :: HasCallStack => SDoc -callStackDoc = +callStackDoc = prettyCallStackDoc callStack + +prettyCallStackDoc :: CallStack -> SDoc +prettyCallStackDoc cs = hang (text "Call stack:") - 4 (vcat $ map text $ lines (prettyCallStack callStack)) + 4 (vcat $ map text $ lines (prettyCallStack cs)) -- | Panic with an assertion failure, recording the given file and -- line number. Should typically be accessed with the ASSERT family of macros |