B Hackers corner
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Introduction
      • Overview
      • Initialising and Managing a Prolog Project
      • Built-in Predicates
      • SWI-Prolog extensions
      • Modules
      • Tabled execution (SLG resolution)
      • Constraint Logic Programming
      • CHR: Constraint Handling Rules
      • Multithreaded applications
      • Coroutining using Prolog engines
      • Foreign Language Interface
      • Using SWI-Prolog in your browser (WASM)
      • Deploying applications
      • The SWI-Prolog library
      • Hackers corner
        • Examining the Environment Stack
        • Ancestral cuts
        • Intercepting the Tracer
        • Simmulating a debugger interrupt
        • Breakpoint and watchpoint handling
        • Adding context to errors: prolog_exception_hook
        • Hooks using the exception predicate
        • Prolog events
        • Hooks for integrating libraries
        • Hooks for loading files
      • Compatibility with other Prolog dialects
      • Glossary of Terms
      • SWI-Prolog License Conditions and Tools
      • Summary
      • Bibliography
    • Packages

B Hackers corner

This appendix describes a number of predicates which enable the Prolog user to inspect the Prolog environment and manipulate (or even redefine) the debugger. They can be used as entry points for experiments with debugging tools for Prolog. The predicates described here should be handled with some care as it is easy to corrupt the consistency of the Prolog system by misusing them.


Section Index


B.1 Examining the Environment Stack
B.2 Ancestral cuts
B.3 Intercepting the Tracer
B.4 Simmulating a debugger interrupt
B.5 Breakpoint and watchpoint handling
B.6 Adding context to errors: prolog_exception_hook
B.7 Hooks using the exception predicate
B.8 Prolog events
B.9 Hooks for integrating libraries
B.10 Hooks for loading files