6.9.3 Examples of Debugging Runtime Systems

The following examples show how to start Prolog debugging when SICStus is run from within Java via Jasper. The examples assume that the SICStus files are part of a development system installation.

The first example initializes the SICStus system property SP_USE_DEVSYS by setting the environment variable with the same name. This method of passing SICStus system properties also works well when SICStus is embedded in some other, non-Java, program.

$ SP=/usr/local/sicstus4.3.5
$ SP_USE_DEVSYS=yes
$ export SP_USE_DEVSYS
$ java -jar \
       "$SP/lib/sicstus-4.3.5/bin/jasper.jar"
Trying to load SICStus.
% The debugger will first creep -- showing everything (trace)
        1      1 Call: write('If you see this message, you have successfully') ? RET
If you see this message, you have successfully
        1      1 Exit: write('If you see this message, you have successfully') ? n

initialized the SICStus Prolog engine.
$ unset SP_USE_DEVSYS

The second example initializes the SICStus system property SP_USE_DEVSYS by setting the Java system property se.sics.sicstus.property.SP_USE_DEVSYS. This method of passing SICStus system properties is specific to Jasper.

$ SP='/usr/local/sicstus4.3.5'
$ java -Dse.sics.sicstus.property.SP_USE_DEVSYS=yes \
       -jar "$SP/lib/sicstus-4.3.5/bin/jasper.jar"
Trying to load SICStus.
% The debugger will first creep -- showing everything (trace)
        1      1 Call: write('If you see this message, you have successfully') ? n
If you see this message, you have successfully
initialized the SICStus Prolog engine.
$ 

Send feedback on this subject.