[commit: ghc] master: Comment improvements on interpreter breakpoint IO action (50972d6)
git at git.haskell.org
git at git.haskell.org
Tue Mar 13 12:26:52 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/50972d6f7c53d32d324eb5ca96d0a3f8794bdb38/ghc
>---------------------------------------------------------------
commit 50972d6f7c53d32d324eb5ca96d0a3f8794bdb38
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Tue Mar 13 15:25:53 2018 +0300
Comment improvements on interpreter breakpoint IO action
[skip ci]
>---------------------------------------------------------------
50972d6f7c53d32d324eb5ca96d0a3f8794bdb38
libraries/ghci/GHCi/Run.hs | 7 ++++++-
rts/Interpreter.c | 10 +++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs
index d058775..2988ec2 100644
--- a/libraries/ghci/GHCi/Run.hs
+++ b/libraries/ghci/GHCi/Run.hs
@@ -298,7 +298,12 @@ setStepFlag = poke stepFlag 1
resetStepFlag :: IO ()
resetStepFlag = poke stepFlag 0
-type BreakpointCallback = Int# -> Int# -> Bool -> HValue -> IO ()
+type BreakpointCallback
+ = Int# -- the breakpoint index
+ -> Int# -- the module uniq
+ -> Bool -- exception?
+ -> HValue -- the AP_STACK, or exception
+ -> IO ()
foreign import ccall "&rts_breakpoint_io_action"
breakPointIOAction :: Ptr (StablePtr BreakpointCallback)
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 0e80593..9eb6560 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -289,7 +289,7 @@ static StgWord app_ptrs_itbl[] = {
};
HsStablePtr rts_breakpoint_io_action; // points to the IO action which is executed on a breakpoint
- // it is set in main/GHC.hs:runStmt
+ // it is set in main/GHC.hs:runStmt
Capability *
interpretBCO (Capability* cap)
@@ -1098,10 +1098,10 @@ run_BCO:
// Arrange the stack to call the breakpoint IO action, and
// continue execution of this BCO when the IO action returns.
//
- // ioAction :: Bool -- exception?
+ // ioAction :: Int# -- the breakpoint index
+ // -> Int# -- the module uniq
+ // -> Bool -- exception?
// -> HValue -- the AP_STACK, or exception
- // -> Int -- the breakpoint index (arg2)
- // -> Int -- the module uniq (arg3)
// -> IO ()
//
ioAction = (StgClosure *) deRefStablePtr (
@@ -1111,7 +1111,7 @@ run_BCO:
SpW(10) = (W_)obj;
SpW(9) = (W_)&stg_apply_interp_info;
SpW(8) = (W_)new_aps;
- SpW(7) = (W_)False_closure; // True <=> a breakpoint
+ SpW(7) = (W_)False_closure; // True <=> an exception
SpW(6) = (W_)&stg_ap_ppv_info;
SpW(5) = (W_)BCO_LIT(arg3_module_uniq);
SpW(4) = (W_)&stg_ap_n_info;
More information about the ghc-commits
mailing list