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

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl
      • lists.pl
      • broadcast.pl -- Event service
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl -- Generate unique symbols
      • settings.pl -- Setting management
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl
      • operators.pl -- Manage operators
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl -- Lambda expressions
      • assoc.pl -- Binary associations
      • prolog_format.pl -- Analyse format specifications
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • predicate_options.pl -- Access and analyse predicate options
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl -- Operations on atoms
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl
      • url.pl -- Analysing and constructing URL
      • www_browser.pl -- Open a URL in the users browser
      • prolog_pack.pl
      • git.pl
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl -- Quintus compatibility
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_wrap.pl -- Wrapping predicates
      • dialect.pl
      • date.pl -- Process dates and times
      • persistency.pl -- Provide persistent dynamic predicates
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl -- String utilities
      • dif.pl
      • edinburgh.pl
      • terms.pl -- Term manipulation
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • 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
      • prolog_stack.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl -- Well Founded Semantics interface
      • sort.pl
      • dicts.pl
      • varnumbers.pl
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • prolog_deps.pl
      • rwlocks.pl
      • tableutil.pl
      • prolog_jiti.pl
      • increval.pl
      • tables.pl -- XSB interface to tables
      • listing.pl -- List programs and pretty print clauses
      • prolog_trace.pl
      • statistics.pl -- Get information about resource usage
      • qpforeign.pl
      • base32.pl
      • portray_text.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • when.pl
      • ctypes.pl -- Character code classification
      • optparse.pl
      • prolog_autoload.pl
      • check.pl
      • prolog_codewalk.pl -- Prolog code walker
      • nb_rbtrees.pl -- Non-backtrackable operations on red black trees
      • prolog_metainference.pl
      • make.pl
      • thread.pl
      • check_installation.pl -- Check installation issues and features
      • prolog_coverage.pl
      • nb_set.pl
      • streams.pl -- Manage Prolog streams
      • edit.pl
      • shell.pl
      • hashtable.pl
      • writef.pl
      • help.pl -- Text based manual
      • prolog_debug.pl -- User level debugging tools
      • system.pl -- System utilities
      • tty.pl
      • qsave.pl -- Save current program as a state or executable
      • prolog_profile.pl -- Execution profiler
      • zip.pl -- Access resource ZIP archives
      • macros.pl
      • exceptions.pl -- Exception classification
      • readln.pl
      • explain.pl -- Describe Prolog Terms
      • intercept.pl
      • fastrw.pl
      • prolog_history.pl
      • oset.pl
      • files.pl
      • pio.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).