summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2015-10-31 17:38:34 +0000
committerSimon Marlow <marlowsd@gmail.com>2015-12-21 18:51:26 +0000
commitc8c44fd91b509b9eb644c826497ed5268e89363a (patch)
tree90bc2f24a7886afb8f0036b322f839168c880057 /includes
parentee6fba89b066fdf8408e6a18db343a4177e613f6 (diff)
downloadhaskell-c8c44fd91b509b9eb644c826497ed5268e89363a.tar.gz
Maintain cost-centre stacks in the interpreter
Summary: Breakpoints become SCCs, so we have detailed call-stack info for interpreted code. Currently this only works when GHC is compiled with -prof, but D1562 (Remote GHCi) removes this constraint so that in the future call stacks will be available without building your own GHCi. How can you get a stack trace? * programmatically: GHC.Stack.currentCallStack * I've added an experimental :where command that shows the stack when stopped at a breakpoint * `error` attaches a call stack automatically, although since calls to `error` are often lifted out to the top level, this is less useful than it might be (ImplicitParams still works though). * Later we might attach call stacks to all exceptions Other related changes in this diff: * I reduced the number of places that get ticks attached for breakpoints. In particular there was a breakpoint around the whole declaration, which was often redundant because it bound no variables. This reduces clutter in the stack traces and speeds up compilation. * I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few other small cleanups Test Plan: validate Reviewers: ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1595 GHC Trac Issues: #11047
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/prof/CCS.h1
-rw-r--r--includes/stg/MiscClosures.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/includes/rts/prof/CCS.h b/includes/rts/prof/CCS.h
index 607931d536..f3c158d8e2 100644
--- a/includes/rts/prof/CCS.h
+++ b/includes/rts/prof/CCS.h
@@ -174,6 +174,7 @@ extern unsigned int RTS_VAR(era);
CostCentreStack * pushCostCentre (CostCentreStack *, CostCentre *);
void enterFunCCS (StgRegTable *reg, CostCentreStack *);
+CostCentre *mkCostCentre (char *label, char *module, char *srcloc);
/* -----------------------------------------------------------------------------
Registering CCs and CCSs
diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
index 06d937a6c9..1236d735ff 100644
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -446,6 +446,7 @@ RTS_FUN_DECL(stg_numSparkszh);
RTS_FUN_DECL(stg_noDuplicatezh);
RTS_FUN_DECL(stg_traceCcszh);
+RTS_FUN_DECL(stg_clearCCSzh);
RTS_FUN_DECL(stg_traceEventzh);
RTS_FUN_DECL(stg_traceMarkerzh);