GUI debugger hangs

I’m using: SWI-Prolog version 8.1.13

When I attempt to trace within one particular program, the process hangs. At the bottom it says, “Cross referencing buffer”. After about 10 minutes it finishes cross-referencing and I can see the trace.

I suspect the cause is goal_expansion stuff. Given that, I don’t know how to approach resolving the problem. The program won’t function without the rewrites.

:- module(plateOrder, [allowed_mold_base/1,
		       allowed_mold_base/4,
		       allowed_insertion/3,
		       named_plates/2
		      ]).
:- include(loop_expansion).
:- include(goal_expansion).

allowed_mold_base(PlateList, CavReversed, Stack, CoreSidePlates)  :-
	%% divide full plate list into two halves
	trace, 
        .... % really simple function.

… other code that involves this expansion stuff.

%loop_expansion.pl
% to use this, must include this file from within other *modules*.

:- include(ops).

:- module_transparent t00/2.

t00(Extra0, Extra1) :-
gen:transform_term(Extra0, [], [], [Extra1], [])

goal_expansion(loop X, Result) :-
gen:transform_hook(loop X, Extra0, [Result], [])
, maplist(t00, Extra0, Extras)
, compile_aux_clauses(Extras).

.

%goal_expansion.pl
% to use this, must include this file from within other *modules*.

goal_expansion(X, Result) :-
	gen:transform_term(X, [], [], [Result], []).