Graphic debugger switching to different view spontaneously?

I’m using: SWI-Prolog version 8.0.2 on Windows 8.1

I can’t detect the pattern yet but every now and then while tracing the graphic debugger suddenly changes to a different way of displaying variables. Instead of seeing the original variable names in the code I see single character variable names and the clauses are now prefixed with the string ‘user:’.

Does anyone know how to stop this from from happening and how to switch it back once it does? I notice that the title of the debugger says “decompiled” now but I don’t know what happened to put it in that mode.

Here is a screen shot:

image

Here is the original source. Usually the code in the debugger would look exactly like the source, not like in the picture above:

inspect_arguments([argtest(Arg, ArgTest) | T]) :-
	argtest(ArgTest, Arg),
	inspect_arguments(T).
1 Like

It switches to decompiled mode if it fails doing the source level debugging. The reasons can be manifold. Sometimes there simply is no source (dynamic code), sometimes relating the sources to the current compiled form fails due to code transformations (goal/term expansion, but also transformations by the compiler backend) and sometimes the source code has been modified, so the locations do not line up anymore.

2 Likes

Ok, given your response, doing a consult while the debugger is paused at a trace point might be what is doing it. I’ll do some more testing. Thanks.

If you reload the code (make/0, consult/1), you typically need to do a retry in the tracer to restart the current goal with the new implementation. There could well be scenarios where the tracer behaves not entirely as it should in such scenarios. Note that active clauses during the reload will keep using the old definition while new calls use the new definition. Reloading itself tries to preserve the old clauses if they have not been changed to minimize the consequences.

2 Likes