/usr/local/lib/swipl/library/threadutil.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl -- Apply predicates on a list
      • lists.pl -- List Manipulation
      • broadcast.pl
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl -- Generate unique symbols
      • settings.pl -- Setting management
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl -- Read utilities
      • operators.pl -- Manage operators
      • pairs.pl -- Operations on key-value lists
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • predicate_options.pl -- Access and analyse predicate options
      • sandbox.pl -- Sandboxed Prolog code
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl -- Lambda expressions
      • assoc.pl -- Binary associations
      • prolog_format.pl
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl -- Ordered set manipulation
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl -- Pretty Print Prolog terms
      • atom.pl -- Operations on atoms
      • modules.pl -- Module utility predicates
      • occurs.pl
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl
      • www_browser.pl
      • prolog_pack.pl
      • git.pl -- Run GIT commands
      • rbtrees.pl -- Red black trees
      • dif.pl -- The dif/2 constraint
      • charsio.pl -- I/O on Lists of Character Codes
      • prolog_stack.pl
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • wfs.pl -- Well Founded Semantics interface
      • dialect.pl -- Support multiple Prolog dialects
      • prolog_code.pl -- Utilities for reasoning about code
      • sort.pl
      • iostream.pl -- Utilities to deal with streams
      • dicts.pl -- Dict utilities
      • varnumbers.pl -- Utilities for numbered terms
      • strings.pl -- String utilities
      • ctypes.pl -- Character code classification
      • backcomp.pl -- Backward compatibility
      • thread.pl -- High level thread primitives
      • tables.pl
      • shell.pl
      • prolog_jiti.pl
      • ansi_term.pl
      • listing.pl -- List programs and pretty print clauses
      • date.pl
      • base32.pl
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • nb_set.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • statistics.pl
      • terms.pl -- Term manipulation
      • when.pl -- Conditional coroutining
      • hashtable.pl -- Hash tables
      • optparse.pl -- command line parsing
      • make.pl -- Reload modified source files
      • threadutil.pl -- Interactive thread utilities
        • threads/0
        • join_threads/0
        • with_stopped_threads/2
        • thread_has_console/0
        • attach_console/0
        • attach_console/1
        • tspy/1
        • tspy/2
        • tdebug/0
        • tdebug/1
        • tnodebug/0
        • tnodebug/1
        • tbacktrace/1
        • tbacktrace/2
        • tprofile/1
        • thread_alias/1
      • qsave.pl
      • zip.pl -- Access resource ZIP archives
      • quintus.pl -- Quintus compatibility
      • prolog_debug.pl -- User level debugging tools
      • prolog_profile.pl -- Execution profiler
      • intercept.pl -- Intercept and signal interface
      • exceptions.pl -- Exception classification
      • prolog_coverage.pl -- Coverage analysis tool
      • prolog_autoload.pl -- Autoload all dependencies
      • check.pl -- Consistency checking
      • files.pl
      • increval.pl -- Incremental dynamic predicate modification
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • system.pl -- System utilities
      • prolog_codewalk.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
      • prolog_qlfmake.pl -- Compile the library to QLF format
      • edit.pl
      • fastrw.pl
      • prolog_trace.pl
      • writef.pl
      • prolog_wrap.pl
      • macros.pl
      • rwlocks.pl
 tdebug is det
 tdebug(+ThreadOrClass) is det
 tnodebug is det
 tnodebug(+ThreadOrClass) is det
Enable or disable a thread or group of threads for debugging using the graphical tracer. A group of threads is addressed based on the class property of a thread set by thread_create/3 or set_thread/2. This implies loading the graphical tracer and switching the thread to debug mode using debug/0. New threads created inherit their debug mode from the thread that created them.

Thread classes have been introduced in SWI-Prolog 10.0.2/10.1.5. This allows for more selective debugging as well as ensuring debugging works in newly created threads. For example, the HTTP server creates all its worker threads in the class http. Using query below, we reliable make sure spy points are trapped in HTTP handler threads, regardless of whether the worker existed or is lazily created and regardless of whether the user switched to nodebug mode while tracing a previous event (see debug_reset_from_class/0).

?- tdebug(http).