| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.ByteCode.Breakpoints
Description
Breakpoint information constructed during ByteCode generation.
Specifically, code-generation breakpoints are referred to as "internal
breakpoints", the internal breakpoint data for a module is stored in
InternalModBreaks, and is uniquely identified at runtime by an
InternalBreakpointId.
See Note [ModBreaks vs InternalModBreaks] and Note [Breakpoint identifiers]
Synopsis
- data InternalModBreaks = InternalModBreaks {}
- data CgBreakInfo = CgBreakInfo {
- cgb_tyvars :: ![IfaceTvBndr]
- cgb_vars :: ![Maybe (IfaceIdBndr, Word)]
- cgb_resty :: !IfaceType
- cgb_tick_id :: !(Either InternalBreakLoc BreakpointId)
- mkInternalModBreaks :: Module -> IntMap CgBreakInfo -> ModBreaks -> InternalModBreaks
- imodBreaks_module :: InternalModBreaks -> Module
- data InternalBreakpointId = InternalBreakpointId {}
- type BreakInfoIndex = Int
- newtype InternalBreakLoc = InternalBreakLoc {}
- getInternalBreak :: InternalBreakpointId -> InternalModBreaks -> CgBreakInfo
- getBreakLoc :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO SrcSpan
- getBreakVars :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [OccName]
- getBreakDecls :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [String]
- getBreakCCS :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO (String, String)
- getBreakSourceId :: InternalBreakpointId -> InternalModBreaks -> BreakpointId
- getBreakSourceMod :: InternalBreakpointId -> InternalModBreaks -> Module
- seqInternalModBreaks :: InternalModBreaks -> ()
Internal Mod Breaks
data InternalModBreaks Source #
Internal mod breaks store the runtime-relevant information of breakpoints.
Importantly, it maps InternalBreakpointIds to CgBreakInfo.
InternalModBreaks are constructed during bytecode generation and stored in
CompiledByteCode afterwards.
Constructors
| InternalModBreaks | |
Fields
| |
Instances
| Binary InternalModBreaks Source # | |
Defined in GHC.ByteCode.Breakpoints Methods put_ :: WriteBinHandle -> InternalModBreaks -> IO () Source # put :: WriteBinHandle -> InternalModBreaks -> IO (Bin InternalModBreaks) Source # get :: ReadBinHandle -> IO InternalModBreaks Source # | |
data CgBreakInfo Source #
Information about a breakpoint that we know at code-generation time
In order to be used, this needs to be hydrated relative to the current HscEnv by
hydrateCgBreakInfo. Everything here can be fully forced and that's critical for
preventing space leaks (see #22530)
Constructors
| CgBreakInfo | |
Fields
| |
Instances
| Binary CgBreakInfo Source # | |
Defined in GHC.ByteCode.Breakpoints Methods put_ :: WriteBinHandle -> CgBreakInfo -> IO () Source # put :: WriteBinHandle -> CgBreakInfo -> IO (Bin CgBreakInfo) Source # get :: ReadBinHandle -> IO CgBreakInfo Source # | |
| Outputable CgBreakInfo Source # | |
Defined in GHC.ByteCode.Breakpoints Methods ppr :: CgBreakInfo -> SDoc Source # | |
mkInternalModBreaks :: Module -> IntMap CgBreakInfo -> ModBreaks -> InternalModBreaks Source #
Construct an InternalModBreaks.
INVARIANT: The given ModBreaks correspond to the same module as this
InternalModBreaks module (the first argument) and its breakpoint infos
(the IntMap CgBreakInfo argument)
imodBreaks_module :: InternalModBreaks -> Module Source #
Get the module to which these InternalModBreaks correspond
Internal breakpoint identifier
data InternalBreakpointId Source #
Internal breakpoint identifier
Indexes into the structures in the produced during ByteCode generation.
See Note [Breakpoint identifiers]InternalModBreaks
Constructors
| InternalBreakpointId | |
Fields
| |
Instances
type BreakInfoIndex = Int Source #
Internal breakpoint info index
newtype InternalBreakLoc Source #
Breakpoints created during code generation don't have a source-level tick location. Instead, we re-use an existing one.
Constructors
| InternalBreakLoc | |
Fields | |
Instances
| NFData InternalBreakLoc Source # | |
Defined in GHC.ByteCode.Breakpoints Methods rnf :: InternalBreakLoc -> () Source # | |
| Binary InternalBreakLoc Source # | |
Defined in GHC.ByteCode.Breakpoints Methods put_ :: WriteBinHandle -> InternalBreakLoc -> IO () Source # put :: WriteBinHandle -> InternalBreakLoc -> IO (Bin InternalBreakLoc) Source # get :: ReadBinHandle -> IO InternalBreakLoc Source # | |
| Outputable InternalBreakLoc Source # | |
Defined in GHC.ByteCode.Breakpoints Methods ppr :: InternalBreakLoc -> SDoc Source # | |
| Eq InternalBreakLoc Source # | |
Defined in GHC.ByteCode.Breakpoints Methods (==) :: InternalBreakLoc -> InternalBreakLoc -> Bool Source # (/=) :: InternalBreakLoc -> InternalBreakLoc -> Bool Source # | |
Operations
Internal-level operations
getInternalBreak :: InternalBreakpointId -> InternalModBreaks -> CgBreakInfo Source #
Get an internal breakpoint info by InternalBreakpointId
Source-level information operations
getBreakLoc :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO SrcSpan Source #
Get the source span for this breakpoint
getBreakVars :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [OccName] Source #
Get the vars for this breakpoint
getBreakDecls :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [String] Source #
Get the decls for this breakpoint
getBreakCCS :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO (String, String) Source #
Get the decls for this breakpoint
getBreakSourceId :: InternalBreakpointId -> InternalModBreaks -> BreakpointId Source #
Get the source module and tick index for this breakpoint
(as opposed to the module where this breakpoint occurs, which is in InternalBreakpointId)
getBreakSourceMod :: InternalBreakpointId -> InternalModBreaks -> Module Source #
Get the source module for this breakpoint (where the breakpoint is defined)
Utils
seqInternalModBreaks :: InternalModBreaks -> () Source #
Fully force an InternalModBreaks value