Cannot get stack dump from a Mercury program

What happens

My Mercury program compiles just fine but if I try to run it I get an error without its accompanying stack trace

What do you understand or find about that problem

I’m trying to finish a challenge that involves a lot of list operations, however when I run the program it tells me that there’s an Index out of bounds somewhere, the thing is, the only information I get, the guilty method, is one I don’t even use once throughout my code.

You make any workaround? What did you do?

I have tried to switch off parts of the code and check the output, but there are too many ways this could be done, I looked at the list boundary checks and they all seem sound to me. I’ve also tried to find out how to install a different ‘grade’ to allow debugging or at least see the stack dump but to no avail.


I have to mention again that I haven’t used this method once throughout the code, I did use its sister method det_index1 which is a 1-based list getter.

I need help with

Installing a mercury grade that allows me to see where this error is coming from.

Solution: By checking the grades in this page: Mercury packages for .deb based systems

It was possible to get a stack dump compiling the code with the command:

mmc --grade asm_fast.gc.decldebug.stseg [mercury filename].m

1 Like