[m-rev.] for post-commit review: fill in most of the grade modifiers section

Julien Fischer jfischer at opturion.com
Fri Aug 8 14:19:45 AEST 2025


Hi Zoltan,

On Thu, 7 Aug 2025 at 15:14, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:

> The second is for .c_debug. The issue here is a contradiction.
> It is clear that this grade component is for MLDS grades, but for
> which targets?

Why is that clear? Does that grade component not apply to the LLDS
grades at all?  Using gdb-level debugging will obviously be significantly
less useful in many of the LLDS grades because:

1. The Mercury-level debugger is available in those grades.
2. Some of what we do in the asm_fast and reg grades might be a bit
   "interesting"  for gdb.

That said, I cannot think of any reason why running a program in say
none.gc.c_debug under gdb should not work.  If you are trying to debug
the contents of foreign_proc or foreign_code pragmas, you may well want
to do this.

> The name says it is for C, compile_target_code.m
> says it is for C (i.e. the code for compiling Java and C# files does not
> consult the option representing it), but the code that computes grades
> accepts its presence when targeting Java or C#.

The original motivation for the addition of .c_debug (then, .ll_debug) was
for debugging problems in C grades.

README.Java.md has a section on "Java-level debugging".  As written,
it looks as though debugging symbols would only be present for classes
in your program, not those of the standard library.

> I can see two ways to resolve this contradiction. One is to stop accepting
> java.c_debug and csharp.c_debug grades. The other is to rename the
> modifier to .target_debug, and make compile_target_code.m pay attention
> to it when compiling Java and C# files. I think the second way is preferable,
> *provided* that there is a single, at-least-relatively-stable way to enable
> debuggability of Java and C# code.

There is. The handling of the --target-debug _option_ in the compiler
is correct for
Java and probably correct for C#.  I don't think anything is required for the
.target_debug grade beyond ensuring that is enabled.

(I will take a look into what is going on with --target-debug and C#; I suspect
there might be some bitrot there.)

Julien.


More information about the reviews mailing list