swipl-devel
swipl-devel copied to clipboard
--debug vs debug flag
> swipl --debug=true
Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.15)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- current_prolog_flag(debug, X).
X = false.
gets even crazier:
> swipl --debug=true -g debug
?- current_prolog_flag(debug, X).
X = false.
?- debug.
true.
[debug] ?- current_prolog_flag(debug, X).
X = true.
The --debug option affects the generate_debug_info flag according to the docs. -g debug probably doesn't work because the -g goals are executed with some isolation that restores several settings after completion of the option. If you want to debug a goal from the commandline you probably need -g debug,mygoal