HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleghc-9.14.1GHC2021

GHC.Runtime.Debugger.Breakpoints

GHC API debugger module for finding and setting breakpoints.

This module is user facing and is at least used by GHCi and `ghc-debugger` to find and set breakpoints.

  • 2 types
  • 12 values
  • Packageghc-9.14.1
  • Exports14
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceBreakpoints.hs

Find a breakpoint given a Module's TickArray and the line number.

When a line number is specified, the current policy for choosing the best breakpoint is this: - the leftmost complete subexpression on the specified line, or - the leftmost subexpression starting on the specified line, or - the rightmost subexpression enclosing the specified line

Process and validate the user string of form [Module.]function into the relevant module information and function name.

Validation guarantees 1. The module exists 2. The identifier is in an interpreted module 3. The identifier has a breakpoint entry in the module's ModBreaks

Returns either an error SDoc or the Module and ModuleInfo for the relevant module paired with the function name

See also Note [Setting Breakpoints by Id]

valuefindBreakForBind
  1. :: String

    Name of bind to break at

  2. -> ModBreaks
  3. -> [(BreakTickIndex, RealSrcSpan)]
#

The aim of this function is to find the breakpoints for all the RHSs of the equations corresponding to a binding. So we find all breakpoints for (a) this binder only (it maybe a top-level or a nested declaration) (b) that do not have an enclosing breakpoint

A source-level breakpoint may have been inlined into many occurrences, now referred by InternalBreakpointId. When a breakpoint is set on a certain source breakpoint, it means all *ocurrences* of that breakpoint across modules should be stopped at -- hence we keep a trie from BreakpointId to the list of internal break ids using it. See also Note [Breakpoint identifiers]