# Gui tracer bad locations of calls

**URL:** <https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421>\
**Category:** Help!\
**Created:** [October 22, 2019, 5:48pm UTC](https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421 "2019-10-22T17:48:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![domibd](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@domibd](https://swi-prolog.discourse.group/u/domibd)\
**Post date:** [October 22, 2019, 5:48pm UTC](https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421/1 "2019-10-22T17:48:49Z")

</div>

Hello,

I’m using SWI-Prolog (threaded, 64 bits, version 8.0.3) under Ubuntu 18.04,  
and wrote a big program (about 25 modules).

I use gtrace (graphical debugger), but each time I experience bad locations of calls  
(the debugger does not show the correct line).  
I have check my files contain correct end of line (LF) and use dos2unix program to ensure it,  
but the problem remains.  
I generally edit my files with gedit. Even I edit them with the

Could you help me ?  
Thanks a lot

Dominique

---

<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:** [October 22, 2019, 5:53pm UTC](https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421/2 "2019-10-22T17:53:38Z")

</div>

> [@domibd](#):
>
> Could you help me ?

I am no expert on gtrace but any time I edit a source code file other than the main one I find it better to halt SWI-Prolog which will end it, restart SWI-Prolog and consult the main file again. The gtrace usually works as expected.

There may be a better solution to this but I am not aware of it.

---

<div class="post-metadata">

**Author:** ![domibd](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@domibd](https://swi-prolog.discourse.group/u/domibd)\
**Post date:** [October 23, 2019, 10:43am UTC](https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421/3 "2019-10-23T10:43:26Z")

</div>

Thanks you for your answer.  
Unfortunately it did work.

---

<div class="post-metadata">

**Author:** ![domibd](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@domibd](https://swi-prolog.discourse.group/u/domibd)\
**Post date:** [October 23, 2019, 3:11pm UTC](https://swi-prolog.discourse.group/t/gui-tracer-bad-locations-of-calls/1421/4 "2019-10-23T15:11:15Z")

</div>

For a reason I do not understand, gtrace works fine when I open the file containing the predicate I want trace (by edit/1), and OPEN THE PROLOG NAVIGATOR.

If the Prolog navigator is not open, the trace does not show the correct lines  
(bad locations).

Great mystery.
