6.9 Debugging Runtime Systems

A runtime system does not contain the Prolog debugger by default. This makes it hard to troubleshoot problems that only occur when the code is embedded in some other application.

As of release 4.2, it is possible to tell a runtime system to start the full development system instead. This way, the Prolog debugger, compiler etc. can be used to debug the application, either from the command line or by attaching to the SICStus Prolog IDE (SPIDER). In the simplest case, this feature is enabled by setting the system property (or environment variable) SP_USE_DEVSYS to yes before starting the runtime system. This will cause the runtime system to become a development system and it will start the debugger, as if by a call to trace/0. See Building for a Target Machine for a complete example.

For best effect, you should ensure that any compiled prolog code (‘.sav’ and ‘.po’ files) has been compiled with the Prolog flag source_info enabled, i.e. with set_prolog_flag(source_info, on). When the runtime system is started as a development system in this way, it needs to be able to find the file that makes up an ordinary development system, i.e. spds.sav; see Runtime Systems on UNIX Target Machines and Runtime Systems on Windows Target Machines, above. It also needs to find the license information for the development system; see Locating the License Information, below.

Send feedback on this subject.