[m-users.] Debugger, setting initial breakpoint not triggering

Sean Charles (emacstheviking) objitsu at gmail.com
Wed Dec 14 06:25:01 AEDT 2022


I usually build with hlc.gc and opted for the first hlc flavour mentioning debug hence my erroneous choice.

I began reading here: https://www.mercurylang.org/information/doc-latest/mercury_user_guide/Debugging.html#Debugging

	Mercury supports two broad ways of preparing a program for debugging.
	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”

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!

When I run configure like this:

./configure --enable-hlc-low-level-debug-grades --disable-java-grade

I get:

the set of library grades to install will be
   hlc.gc
   hlc.gc.memprof
   hlc.gc.prof
   hlc.gc.tr
   hlc.gcd.ll_debug
   hlc.par.gc
   none.gc
   none.gc.debug.stseg
   none.gc.decldebug.stseg
   none.gc.prof
   none.gc.profdeep.stseg
   none.gc.tr.debug.stseg
   none.par.gc.stseg

Configuring to install 13 grades.
This will likely take 2 to 7 hours.


So according to the documentation then, what does --enable-hlc-low-level-debug-grades actually do for me if it isn't provding me with a debug grade for hlc?

  --enable-hlc-low-level-debug-grades
                          install a low-level debugging version of the high
                          level C grade


After some reading of the above page, and the compiler configure -h output I built with:

./configure --enable-hlc-low-level-debug-grades --disable-java-grade --enable-additional-libgrades=asm_fast.gc.debug,asm_fast.gc,asm_fast.gc.decldebug

   asm_fast.gc
   asm_fast.gc.debug
   asm_fast.gc.decldebug
   hlc.gc
   hlc.gc.memprof
   hlc.gc.prof
   hlc.gc.tr
   hlc.gcd.ll_debug
   hlc.par.gc
   none.gc
   none.gc.debug.stseg
   none.gc.decldebug.stseg
   none.gc.prof
   none.gc.profdeep.stseg
   none.gc.tr.debug.stseg
   none.par.gc.stseg

Sadly, this just ended up with:

mgnuc: For compilers other than GNU C, the only
mgnuc: base grade allowed is `none'
clang: error: unknown argument: '-fno-function-cse'
clang: warning: optimization flag '-fno-defer-pop' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-fno-gcse' is not supported [-Wignored-optimization-argument]
make[3]: *** [alloc.o] Error 1
make[2]: *** [submake] Error 2
To clean up from failed install, remove /Users/seancharles/Documents/code/mercury/mercury-srcdist-22.01.4/install_grade_dir.asm_fast.gc
make[1]: *** [install_grades] Error 1
make: *** [install] Error 2

After some playing around I came up with this configuration line:

./configure --enable-hlc-low-level-debug-grades --disable-java-grade --enable-additional-libgrades=none.gc,none.gc.debug

and then managed to select none.gc coupled with the --debug flag, resulting in a build that now triggers the expected operation of mdb:


Melbourne Mercury Debugger, mdb version 22.01.4.
Copyright 1998-2012 The University of Melbourne.
Copyright 2013-2022 The Mercury team.
mdb is free software; there is absolutely no warranty for mdb.
       1:      1  1 CALL pred felt.main/2-0 (det) felt.m:43
Registering debuggable procedures... done.
There are 162 debuggable modules, with a total of 13267 procedures.
 0: + stop  linenumber felt.m:44
 1: + stop  linenumber ast.m:87
mdb>


Many thanks once again Zoltan.

Sean




> On 13 Dec 2022, at 13:05, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
> 
> 
> 2022-12-13 23:55 GMT+11:00 "Sean Charles (emacstheviking)" <objitsu at gmail.com>:
>> Asking for the list of grades I get:
>> 
>> ➜  f2 git:(ast-review) ✗ mmc  --output-stdlib-grades
>> hlc.gc
>> hlc.gc.memprof
>> hlc.gc.prof
>> hlc.gc.tr
>> hlc.gcd.ll_debug
>> hlc.par.gc
>> none.gc
>> none.gc.debug.stseg
>> none.gc.decldebug.stseg
>> none.gc.prof
>> none.gc.profdeep.stseg
>> none.gc.tr.debug.stseg
>> none.par.gc.stseg
> 
> I presume you specifically configured your install to include
> the hlc.gcd.ll_debug grade, since it is not enabled by default.
> 
>> My makefile uses hlc.gcd.ll_debug
> 
> Uses how?
> 
> Not that it matters, because *any* reference to ll_debug by you is a bug.
> 
> The ll_debug grade component is not supposed to be documented.
> It is *completely separate* from the debug grade component, and has
> nothing whatsoever to do with mdb. It is intended *only* to debug
> the compiler's low level code generator, and as such, it is not useful
> to anyone who is not an implementor of the Mercury system.
> 
> Note that something very similar is true for the gcd grade component,
> which is intended only to help debug the interactions between
> Mercury's usual garbage collector and the rest of the system.
> 
> Zoltan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20221213/f3234ba2/attachment-0001.html>


More information about the users mailing list