Collection of reference material about graphical debugger

I’m want to write an “Introduction to the Graphical Debugger” and am trying to find everything that has already been written about it to use as background. Please add anything you know of!

Here’s what I found:

The best (only) overview of the graphical debugger tool itself that I’ve found: https://www.swi-prolog.org/gtrace.html [This is what I am attempting to write a more complete version of]

Reference and discussions:

Common scenarios and some workarounds:

Anything else anyone knows of?

1 Like

Check the Bug hunting toolbox.
SWI-Prolog Debugger FSA.pdf (682.7 KB)
How to get X-windows working with WSL 2 for things such as gtrace

Don’t forget the source code on GitHub
test_gtrace.pl
gui_tracer.pl

Be warned that the Discourse search does not return results in hidden sections such as personal notes in this post.

1 Like

I guess there are a couple of things to discuss

  • How the GUI works. There are surely some things worthwhile explaining (and a graphical designer creating good looking icons and propose how to make a couple of things easier to understand).
  • How to get the debugger started at the right place.
    • Using gtrace/0, gspy/1, tspy/1, etc.
    • Using break points from PceEmacs
    • Adding a call to gtrace/0 in the source code.
  • Debug mode vs nodebug mode execution (last call optimization, garbage collection)
  • Exploit retry to zoom in hierarchically
  • How to find and debug exceptions (Edit exceptions)
  • Edit code, recompile and retry to fix stuff without restarting.
  • Limitations
    • Dynamic code has no source
    • Source code rewriting (goal_expansion/2, term_expansion/2) can cause source level debugging to be replaced by debugging decompiled code.
    • How to fix the above for libraries.

I surely forgot some things …

1 Like

Here is use of a meta_predicate/1 with gtrace/0.

In other words it shows the globe icon being used.

Can you expand on what you mean by that?

See What does the (non-port trace) text coloring in the graphical debugger mean?