SWI-Prolog / swipl-devel

SWI-Prolog Main development repository
http://www.swi-prolog.org
Other
974 stars 176 forks source link

--debug vs debug flag #754

Open koo5 opened 3 years ago

koo5 commented 3 years ago
> 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.
koo5 commented 3 years ago

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.
JanWielemaker commented 3 years ago

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