Break_hook/7

Playing around with breakpoints I added this hook definition and test code:

prolog:break_hook(Clause, PC, FR, BFR, Expression, Debug, Action) :-
    writeln(user_error, break_hook(Clause, PC, FR, BFR, Expression, Debug)),
    Action = continue.


test :-
    writeln(egg).

I added a break point with Ctrl-c b:

I expected the break_hook to write the break point context to user_error but it brought up the graphical tracer and waited for input. Thinking it might just be graphical tracer I turned it off, but the result was the same.

Well, both the hook and breakpoint handling are defined in library(prolog_breakpoints). If you want to get your own hook called you must load it before this library is loaded. Use

 ?- listing(break_hook, [source(true)]).

to see how it is defined and from where.