perform range checking in accordance to GDB rules
The release423 branch supports OCCURS and reference-modification quite well. It does implement some range checks, too, these should be adjusted to work depending on GDB's Range Checking (as with modula-2: default to output an error and ignore the expression, but be adjustable to "warning" and "ignore".
Background: early COBOL had range errors declared as "undefined", in COBOL2002 exception handling was added (which is done in GnuCOBOL depending on the -fec
flags, and --debug
implies -fec=all
).
Programs that were not compiled with those flags on work "in general" identically as in MF or on IBM: they calculate the data offset (often pointing to a complete other variable, possibly also into program space which will then raise a SIGSEGV on write).
While the results differ between compilers if the 01-level is left 1 COBOL and so GnuCOBOL does allow that in principle and it would be good to also allow this controlled in the debugger.
-
different compilers have all the data "in order of definition" and with different alignment in memory, GnuCOBOL has - on most machines an backwards order, aligned on 8 bytes (GC4 has dialect options to adjust that to match all known compilers)
↩