# Visual debugger loses source: listing version shown

**URL:** <https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474>\
**Category:** General\
**Created:** [June 5, 2020, 10:40am UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474 "2020-06-05T10:40:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emacstheviking](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/emacstheviking/32/228_2.png) [@emacstheviking](https://swi-prolog.discourse.group/u/emacstheviking)\
**Post date:** [June 5, 2020, 10:40am UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474/1 "2020-06-05T10:40:40Z")

</div>

This seems to happen more and more. I thought it was connected with stepping between modules but this screen shot shows the listing version of a predicate directly below the one I was in that had the source code showing properly.

 ![debugger](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/2/2c978711d9e4341033a27e296d2eed0bce5cf689.png)

What have I done to upset the debugger gods? It’s very jarring and upsetting to suddenly have to think extra hard about the variables, at times I have had to have the source code open as I single step kind of defeating the object!

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 5, 2020, 11:15am UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474/2 "2020-06-05T11:15:10Z")

</div>

> [@emacstheviking](#):
>
> What have I done to upset the debugger gods

Got the habit of reusing some pattern that doesn’t work? This seems code expanded for a DCG, no? Given the original source, this typically reproduces quite easily. This is normally due to missing logic to restore the source locations in library(prolog\_clause). Basically means debugging clause\_info/4.

Note that I have been working on a completely new approach to deal with source locations, but this project stalled due to other priorities ☹

---

<div class="post-metadata">

**Author:** ![emacstheviking](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/emacstheviking/32/228_2.png) [@emacstheviking](https://swi-prolog.discourse.group/u/emacstheviking)\
**Post date:** [June 5, 2020, 12:00pm UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474/3 "2020-06-05T12:00:35Z")

</div>

Well I must be doing something wrong I’m sure. Up until recently the debugger has been a lifeline at times with sorting out DCG behaviours. That and debug outpuut!

Sigh. I don’t know. First world problems… 😑

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 5, 2020, 12:20pm UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474/4 "2020-06-05T12:20:28Z")

</div>

Another option that sometimes causes issues is line-endings that are not expected, such as \r\n (Windows) files when used on Linux/MacOS.

Yet another is user term/goal expansion rules.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 5, 2020, 12:21pm UTC](https://swi-prolog.discourse.group/t/visual-debugger-loses-source-listing-version-shown/2474/5 "2020-06-05T12:21:48Z")

</div>

I too have run into this problem and while I don’t have a fix or work around that works consistently I did post in here a work around that does work at times.

IIRC in the upper right window I view the frame earlier in the stack, then move back to the current frame. But then again that could be an answer to another problem.
