I’m using SWI-Prolog (threaded, 64 bits, version 8.0.3) under Ubuntu 18.04,
and wrote a big program (about 25 modules).
I use gtrace (graphical debugger), but each time I experience bad locations of calls
(the debugger does not show the correct line).
I have check my files contain correct end of line (LF) and use dos2unix program to ensure it,
but the problem remains.
I generally edit my files with gedit. Even I edit them with the
I am no expert on gtrace but any time I edit a source code file other than the main one I find it better to halt SWI-Prolog which will end it, restart SWI-Prolog and consult the main file again. The gtrace usually works as expected.
There may be a better solution to this but I am not aware of it.
For a reason I do not understand, gtrace works fine when I open the file containing the predicate I want trace (by edit/1), and OPEN THE PROLOG NAVIGATOR.
If the Prolog navigator is not open, the trace does not show the correct lines
(bad locations).