Re: [m-users.] Debugger, setting initial breakpoint not triggering
"Sean Charles (emacstheviking)" <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Julien, Yes, I figured it all out in the end! I installed the none.gc and added --debug and it was all good. The only change I had to make was to replace string-to-int with string-to-number in the gud.el scripts folder and it was all good to go. I raised a PR for that but then I found a better way, emacs has a means to alias out old functions for new which I added to the ticket comment I might try to do it in a cleaner way myself so it is backwards compatible with emacs older than 26.1 Thanks again everybody. Sean. > On 14 Dec 2022, at 01:11, Julien Fischer <[email protected]> wrote: > > > Hi Sean, > > On Tue, 13 Dec 2022, Sean Charles (emacstheviking) wrote: > >> 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? > > The .ll_debug grades prepare the C code generated by the Mercury > compiler for debugging with a C debugger (e.g. gdb). As Zoltan > mentioned the main use for this is debugging issues in the Mercury->C > code generator. > > The other use case for them, and this is probably why the option > --enable-hlc-low-level-debug-grades exists, is debugging Mercury code > that contains substantial amounts of C code (e.g. via pragma > foreign_proc) at the C level. > > Mercury-level debugging is not supported by the high-level C backend at > all. In order to use the Mercury debugger you will need to compile your > code using a debug grade with the the low-level C backend, e.g.: > > asm_fast.gc.debug > reg.gc.debug > none.gc.debug > > etc. > > (Since you appear to be using clang, only the last of those will work.) > > ... > >> 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: > > > The '--debug' flag is an endless source of confusion and we have been > intending to change its behaviour. > > What it currently does is paste ".debug" on to the current grade. > So for example, if your Mercury installation has been configured to use > "hlc.gc" as its default grade and you do this: > > $ mmc --debug foo.m > > Then the compiler will attempt to compile that program in the grade > hlc.gc.debug (which will result in a error somewhere along the process > since that is not supported). > > I suggest instead outputting the installed grades using > --output-stdlib-grades (as you have done) and then picking > one that contains either the "debug" or "decldebug" component > (But not "ll_debug!) and then explitily invoke the compiler with > that. > > (Or install a debug grade if one is not present.) > > Julien. _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users