• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

10.5.1 Debugging threads
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Multithreaded applications
        • Thread support library(threadutil)
          • Debugging threads
            • attach_console/0
            • tdebug/1
            • tdebug/0
            • tnodebug/1
            • tnodebug/0
            • tspy/2
            • tspy/1
    • Packages
Availability::- use_module(library(threadutil)).(can be autoloaded)
Sourceattach_console
If the current thread has no console attached yet, attach one and redirect the user streams (input, output, and error) to the new console window. On Unix systems the console is an xterm application. On Windows systems this requires the GUI version swipl-win.exe rather than the console-based swipl.exe.

This predicate has a couple of useful applications. One is to separate (debugging) I/O of different threads. Another is to start debugging a thread that is running in the background. If thread 10 is running, the following sequence starts the tracer on this thread:

?- thread_signal(10, (attach_console, trace)).
ClioPatria (version V3.1.1-51-ga0b30a5)