From 0855975c5e81b1ef9a7871a436af3f34c55dfd87 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 18 Apr 2007 13:38:56 +0000 Subject: [PATCH] add ':show context' which lists the current stack of breakpoint contexts --- compiler/ghci/InteractiveUI.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 1.7.10.4