debuggingcompilationmercury

How do I compile for debugging in Mercury programming language?


Using Mercury 14.01.1 on Ubuntu 14.04. Have installed four grades, including debugging grades, from source code. Tried each of the following without success (files/directories missing)

$ mmc --debug filename

$ mmc --decl-debug filename

Q. What should I have typed instead?


Solution

  • Mercury is less than user-friendly when it comes to compilation grades. Your installation will be configured to use a default grade, for example hlc.gc. However when you give the --debug option it simply adds .debug onto this grade string (hlc.gc.debug) rather than choosing the most appropriate debug grade (such as asm_fast.gc.debug). Depending on the debugging grade that you've installed I suggest typing:

    mmc --grade <my debug grade> --make my_program
    

    To explicitly specify the grade you want to use. Note also that --make is required to build a whole program or library, without --make mmc will only compile a single file which is usually not what you want. I hope this helps, if you're still having trouble you can write to users@mercurylang.org

    Thanks.