Guitracer with unification of variables in predicate

I have the following little swi-prolog program, let’s call it test.pl to illustrate my problem with the guitracer:

test1(D, B) :-
    D = i(_, _), B = "imp",
    write("test1").


test2(i(_, _), "imp") :- 
	write("test2").

If I start (based on this program) the tracer on swi-prolog with commands:

?- guitracer.
% The graphical front-end will be used for subsequent tracing
true.

?- trace.
true.

and now call the function:
[trace] ?- test1(i(x, y), X).

the decompiler for some reason leads me into some user build functions with no possibilities to set stops:

otherwise if I call:

[trace] ?- test1(i(x, y), X).

the decompiler leads me to a non user build function and it is possible to set stop marks:

This shows it is not possible to unify the variables in the body of the predicate without losing the property to set marks in the guitracer.

What could be the reason for that and is their a possiblity to avoid the problem, even if the parameters have a complex structure so it is a bit confusing to declare them in the head of the predicate?

What version? This issue is fixed in the latest release (8.5.11). In older versions you can use the directive below (before loading the code) to disable migrating unifications from the body to the head.

:- set_prolog_flag(optimise_unify, false).

Note that you cannot set a breakpoint on the migrated head unification. Failing unifications may anyway not be executed because clause indexing skips clauses for which it knows the head can never unify.

I am using the last stable ubuntu version (8.4.2+dfsg-2ubuntu1) I installed based on the tutorial here. Is there a fix for Ubuntu users too?

Thanks with the flag it works.

Yes, install the PPA from the development series SWI Prolog devel : “SWI Prolog” team