<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>I usually build with hlc.gc and opted for the first hlc flavour mentioning debug hence my erroneous choice.</div><div><br></div><div>I began reading here: <a href="https://www.mercurylang.org/information/doc-latest/mercury_user_guide/Debugging.html#Debugging">https://www.mercurylang.org/information/doc-latest/mercury_user_guide/Debugging.html#Debugging</a></div><div><br></div><div><span style="font-family: -webkit-standard; font-size: medium;"><span class="Apple-tab-span" style="white-space:pre"> </span>Mercury supports two broad ways of preparing a program for debugging.</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><span class="Apple-tab-span" style="white-space:pre"> </span>The simpler way is to compile a program in a debugging grade, which you can do directly by specifying a grade that includes the word “debug” or “decldebug”</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><span style="font-family: -webkit-standard; font-size: medium;">So I did just that. I listed the grades available and chose the one I thought was the choice for hlc. I had no idea and as it isn't documented I didn't realise it wasn't for public consumption!</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><span style="font-family: -webkit-standard; font-size: medium;">When I run configure like this:</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><font face="APL385"><span style="font-style: normal;">./configure --enable-hlc-low-level-debug-grades --disable-java-grade</span></font></div><div><br></div><div>I get:</div><div><br></div><div><div><font face="APL385"><span style="font-style: normal;">the set of library grades to install will be</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.gc</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.gc.memprof</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.gc.prof</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.gc.tr</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.gcd.ll_debug</span></font></div><div><font face="APL385"><span style="font-style: normal;"> hlc.par.gc</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc.debug.stseg</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc.decldebug.stseg</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc.prof</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc.profdeep.stseg</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.gc.tr.debug.stseg</span></font></div><div><font face="APL385"><span style="font-style: normal;"> none.par.gc.stseg</span></font></div><div><font face="APL385"><span style="font-style: normal;"><br></span></font></div><div><font face="APL385"><span style="font-style: normal;">Configuring to install 13 grades.</span></font></div><div><font face="APL385"><span style="font-style: normal;">This will likely take 2 to 7 hours.</span></font></div></div><div><br></div><div><br></div><div>So according to the documentation then, what does <span style="font-family: APL385;">--enable-hlc-low-level-debug-grades</span> actually do for me if it isn't provding me with a debug grade for hlc?</div><div><br></div><div><div> --enable-hlc-low-level-debug-grades</div><div> install a low-level debugging version of the high</div><div> level C grade</div></div><div><br></div><div><br></div><div>After some reading of the above page, and the compiler configure -h output I built with:</div><div><br></div><div>./configure --enable-hlc-low-level-debug-grades --disable-java-grade --enable-additional-libgrades=asm_fast.gc.debug,asm_fast.gc,asm_fast.gc.decldebug</div><div><br></div><div><div><b> asm_fast.gc</b></div><div><b> asm_fast.gc.debug</b></div><div><b> asm_fast.gc.decldebug</b></div><div> hlc.gc</div><div> hlc.gc.memprof</div><div> hlc.gc.prof</div><div> hlc.gc.tr</div><div> hlc.gcd.ll_debug</div><div> hlc.par.gc</div><div> none.gc</div><div> none.gc.debug.stseg</div><div> none.gc.decldebug.stseg</div><div> none.gc.prof</div><div> none.gc.profdeep.stseg</div><div> none.gc.tr.debug.stseg</div><div> none.par.gc.stseg</div></div><div><br></div><div>Sadly, this just ended up with:</div><div><br></div><div><div><font face="APL385"><span style="font-style: normal;">mgnuc: For compilers other than GNU C, the only</span></font></div><div><font face="APL385"><span style="font-style: normal;">mgnuc: base grade allowed is `none'</span></font></div><div><font face="APL385"><span style="font-style: normal;">clang: error: unknown argument: '-fno-function-cse'</span></font></div><div><font face="APL385"><span style="font-style: normal;">clang: warning: optimization flag '-fno-defer-pop' is not supported [-Wignored-optimization-argument]</span></font></div><div><font face="APL385"><span style="font-style: normal;">clang: warning: optimization flag '-fno-gcse' is not supported [-Wignored-optimization-argument]</span></font></div><div><font face="APL385"><span style="font-style: normal;">make[3]: *** [alloc.o] Error 1</span></font></div><div><font face="APL385"><span style="font-style: normal;">make[2]: *** [submake] Error 2</span></font></div><div><font face="APL385"><span style="font-style: normal;">To clean up from failed install, remove /Users/seancharles/Documents/code/mercury/mercury-srcdist-22.01.4/install_grade_dir.asm_fast.gc</span></font></div><div><font face="APL385"><span style="font-style: normal;">make[1]: *** [install_grades] Error 1</span></font></div><div><font face="APL385"><span style="font-style: normal;">make: *** [install] Error 2</span></font></div></div><div><br></div><div>After some playing around I came up with this configuration line:</div><div><br></div><div>./configure --enable-hlc-low-level-debug-grades --disable-java-grade --enable-additional-libgrades=none.gc,none.gc.debug</div><div><br></div><div>and then managed to select none.gc coupled with the --debug flag, resulting in a build that now triggers the expected operation of mdb:</div><div><br></div><div><br></div><div><div><font face="APL385"><span style="font-style: normal;">Melbourne Mercury Debugger, mdb version 22.01.4.</span></font></div><div><font face="APL385"><span style="font-style: normal;">Copyright 1998-2012 The University of Melbourne.</span></font></div><div><font face="APL385"><span style="font-style: normal;">Copyright 2013-2022 The Mercury team.</span></font></div><div><font face="APL385"><span style="font-style: normal;">mdb is free software; there is absolutely no warranty for mdb.</span></font></div><div><font face="APL385"><span style="font-style: normal;"> 1: 1 1 CALL pred felt.main/2-0 (det) felt.m:43</span></font></div><div><font face="APL385"><span style="font-style: normal;">Registering debuggable procedures... done.</span></font></div><div><font face="APL385"><span style="font-style: normal;">There are 162 debuggable modules, with a total of 13267 procedures.</span></font></div><div><font face="APL385"><span style="font-style: normal;"> 0: + stop linenumber felt.m:44</span></font></div><div><font face="APL385"><span style="font-style: normal;"> 1: + stop linenumber ast.m:87</span></font></div><div><font face="APL385"><span style="font-style: normal;">mdb></span></font></div></div><div><br></div><div><br></div><div>Many thanks once again Zoltan.</div><div><br></div><div>Sean</div><div><br></div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>On 13 Dec 2022, at 13:05, Zoltan Somogyi <zoltan.somogyi@runbox.com> wrote:</div><br class="Apple-interchange-newline"><div><div><br>2022-12-13 23:55 GMT+11:00 "Sean Charles (emacstheviking)" <objitsu@gmail.com>:<br><blockquote type="cite">Asking for the list of grades I get:<br><br>➜ f2 git:(ast-review) ✗ mmc --output-stdlib-grades<br>hlc.gc<br>hlc.gc.memprof<br>hlc.gc.prof<br>hlc.gc.tr<br>hlc.gcd.ll_debug<br>hlc.par.gc<br>none.gc<br>none.gc.debug.stseg<br>none.gc.decldebug.stseg<br>none.gc.prof<br>none.gc.profdeep.stseg<br>none.gc.tr.debug.stseg<br>none.par.gc.stseg<br></blockquote><br>I presume you specifically configured your install to include<br>the hlc.gcd.ll_debug grade, since it is not enabled by default.<br><br><blockquote type="cite">My makefile uses hlc.gcd.ll_debug<br></blockquote><br>Uses how?<br><br>Not that it matters, because *any* reference to ll_debug by you is a bug.<br><br>The ll_debug grade component is not supposed to be documented.<br>It is *completely separate* from the debug grade component, and has<br>nothing whatsoever to do with mdb. It is intended *only* to debug<br>the compiler's low level code generator, and as such, it is not useful<br>to anyone who is not an implementor of the Mercury system.<br><br>Note that something very similar is true for the gcd grade component,<br>which is intended only to help debug the interactions between<br>Mercury's usual garbage collector and the rest of the system.<br><br>Zoltan.</div></div></blockquote></div><br></div></body></html>