Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
575cb0c3
Commit
575cb0c3
authored
Apr 06, 2013
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split off a InteractiveEvalTypes module to remove an import loop
parent
6534c99e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
42 deletions
+69
-42
compiler/ghc.cabal.in
compiler/ghc.cabal.in
+1
-0
compiler/main/HscTypes.lhs
compiler/main/HscTypes.lhs
+1
-1
compiler/main/InteractiveEval.hs
compiler/main/InteractiveEval.hs
+2
-38
compiler/main/InteractiveEval.hs-boot
compiler/main/InteractiveEval.hs-boot
+0
-3
compiler/main/InteractiveEvalTypes.hs
compiler/main/InteractiveEvalTypes.hs
+65
-0
No files found.
compiler/ghc.cabal.in
View file @
575cb0c3
...
...
@@ -288,6 +288,7 @@ Library
HscStats
HscTypes
InteractiveEval
InteractiveEvalTypes
PackageConfig
Packages
PlatformConstants
...
...
compiler/main/HscTypes.lhs
View file @
575cb0c3
...
...
@@ -114,7 +114,7 @@ module HscTypes (
#ifdef GHCI
import ByteCodeAsm ( CompiledByteCode )
import
{-# SOURCE #-} InteractiveEval
( Resume )
import
InteractiveEvalTypes
( Resume )
#endif
import HsSyn
...
...
compiler/main/InteractiveEval.hs
View file @
575cb0c3
...
...
@@ -38,6 +38,8 @@ module InteractiveEval (
#
include
"HsVersions.h"
import
InteractiveEvalTypes
import
GhcMonad
import
HscMain
import
HsSyn
...
...
@@ -89,37 +91,6 @@ import System.IO.Unsafe
-- -----------------------------------------------------------------------------
-- running a statement interactively
data
RunResult
=
RunOk
[
Name
]
-- ^ names bound by this evaluation
|
RunException
SomeException
-- ^ statement raised an exception
|
RunBreak
ThreadId
[
Name
]
(
Maybe
BreakInfo
)
data
Status
=
Break
Bool
HValue
BreakInfo
ThreadId
-- ^ the computation hit a breakpoint (Bool <=> was an exception)
|
Complete
(
Either
SomeException
[
HValue
])
-- ^ the computation completed with either an exception or a value
data
Resume
=
Resume
{
resumeStmt
::
String
,
-- the original statement
resumeThreadId
::
ThreadId
,
-- thread running the computation
resumeBreakMVar
::
MVar
()
,
resumeStatMVar
::
MVar
Status
,
resumeBindings
::
([
TyThing
],
GlobalRdrEnv
),
resumeFinalIds
::
[
Id
],
-- [Id] to bind on completion
resumeApStack
::
HValue
,
-- The object from which we can get
-- value of the free variables.
resumeBreakInfo
::
Maybe
BreakInfo
,
-- the breakpoint we stopped at
-- (Nothing <=> exception)
resumeSpan
::
SrcSpan
,
-- just a cache, otherwise it's a pain
-- to fetch the ModDetails & ModBreaks
-- to get this.
resumeHistory
::
[
History
],
resumeHistoryIx
::
Int
-- 0 <==> at the top of the history
}
getResumeContext
::
GhcMonad
m
=>
m
[
Resume
]
getResumeContext
=
withSession
(
return
.
ic_resume
.
hsc_IC
)
...
...
@@ -132,13 +103,6 @@ isStep :: SingleStep -> Bool
isStep
RunToCompletion
=
False
isStep
_
=
True
data
History
=
History
{
historyApStack
::
HValue
,
historyBreakInfo
::
BreakInfo
,
historyEnclosingDecls
::
[
String
]
-- declarations enclosing the breakpoint
}
mkHistory
::
HscEnv
->
HValue
->
BreakInfo
->
History
mkHistory
hsc_env
hval
bi
=
let
decls
=
findEnclosingDecls
hsc_env
bi
...
...
compiler/main/InteractiveEval.hs-boot
deleted
100644 → 0
View file @
6534c99e
module
InteractiveEval
(
Resume
)
where
data
Resume
compiler/main/InteractiveEvalTypes.hs
0 → 100644
View file @
575cb0c3
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2007
--
-- Running statements interactively
--
-- -----------------------------------------------------------------------------
module
InteractiveEvalTypes
(
#
ifdef
GHCI
RunResult
(
..
),
Status
(
..
),
Resume
(
..
),
History
(
..
),
#
endif
)
where
#
ifdef
GHCI
import
Id
import
Name
import
RdrName
import
TypeRep
import
ByteCodeInstr
import
ByteCodeLink
import
SrcLoc
import
Exception
import
Control.Concurrent
data
RunResult
=
RunOk
[
Name
]
-- ^ names bound by this evaluation
|
RunException
SomeException
-- ^ statement raised an exception
|
RunBreak
ThreadId
[
Name
]
(
Maybe
BreakInfo
)
data
Status
=
Break
Bool
HValue
BreakInfo
ThreadId
-- ^ the computation hit a breakpoint (Bool <=> was an exception)
|
Complete
(
Either
SomeException
[
HValue
])
-- ^ the computation completed with either an exception or a value
data
Resume
=
Resume
{
resumeStmt
::
String
,
-- the original statement
resumeThreadId
::
ThreadId
,
-- thread running the computation
resumeBreakMVar
::
MVar
()
,
resumeStatMVar
::
MVar
Status
,
resumeBindings
::
([
TyThing
],
GlobalRdrEnv
),
resumeFinalIds
::
[
Id
],
-- [Id] to bind on completion
resumeApStack
::
HValue
,
-- The object from which we can get
-- value of the free variables.
resumeBreakInfo
::
Maybe
BreakInfo
,
-- the breakpoint we stopped at
-- (Nothing <=> exception)
resumeSpan
::
SrcSpan
,
-- just a cache, otherwise it's a pain
-- to fetch the ModDetails & ModBreaks
-- to get this.
resumeHistory
::
[
History
],
resumeHistoryIx
::
Int
-- 0 <==> at the top of the history
}
data
History
=
History
{
historyApStack
::
HValue
,
historyBreakInfo
::
BreakInfo
,
historyEnclosingDecls
::
[
String
]
-- declarations enclosing the breakpoint
}
#
endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment