From: Simon Marlow Date: Wed, 18 Apr 2007 13:38:56 +0000 (+0000) Subject: add ':show context' which lists the current stack of breakpoint contexts X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=0855975c5e81b1ef9a7871a436af3f34c55dfd87 add ':show context' which lists the current stack of breakpoint contexts --- diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index c83e4df..ddd6a13 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1200,7 +1200,8 @@ showCmd str = ["bindings"] -> showBindings ["linker"] -> io showLinkerState ["breaks"] -> showBkptTable - _ -> throwDyn (CmdLineError "syntax: :show [modules|bindings]") + ["context"] -> showContext + _ -> throwDyn (CmdLineError "syntax: :show [modules|bindings|breaks]") showModules = do session <- getSession @@ -1234,6 +1235,13 @@ showBkptTable = do activeBreaks <- getActiveBreakPoints printForUser $ ppr activeBreaks +showContext :: GHCi () +showContext = do + st <- getGHCiState + printForUser $ vcat (map pp_resume (resume st)) + where + pp_resume (span, _, _) = ptext SLIT("Stopped at") <+> ppr span + -- ----------------------------------------------------------------------------- -- Completion