This predicate is particularly useful for debugging large programs that would take too much space or time to run completely with the debugger. The debugger is only switched on in creep mode at the call port of Goal and switched off when Goal exits (or fails, leaves,...).
If the debugger was already on before calling trace/1, it has no effect.
An alternative way of turning on the debugger selectively is to set the start_tracing property of a particular predicate using set_flag/3.
Success: [eclipse]: [user]. p :- big_goal1, trace(buggy_goal), big_goal2. big_goal1. big_goal2. buggy_goal. user compiled 208 bytes in 0.02 seconds yes. [eclipse]: p. % big_goal1/0 is executed without the debugger Start debugging - creep mode (1) 0 CALL buggy_goal %> creep (1) 0 EXIT buggy_goal %> creep Stop debugging. % big_goal2/0 is executed without the debugger yes.