general support (cprint, cwatch, cbreak) for OCCURS and ref-mod
The goal is to allow the COBOL programmer to ask gdb:
`cprint myvar(2,5)´
Up to GnuCOBOL 3.1 RC1 there was no direct hint about OCCURS at all. The suggestion in cobcd branch added a hint in the comment, but still the only way to get a more direct access to the different values in OCCURS would be the information in the dump code that does that.
We possibly need to adjust more in codegen to pass the necessary information to the caller and/or provide a way to ask via a new libcob function for a cob_field, maybe something like
get_occurs_field(cob_field *definition, size_t subscripts, cob_field *sub... )
The hardest part will be varialbe-length arrays (-fodo-slide
, which is the default for ´-std=ibm´, because that's the way this works).
... and a bit of dreaming:
`cprint myvar(cust,rec)´
but this can be internally handled fine if expressions would be provided (#26):
(gdb) cprint cust
1 : 05 cust/my-counters/working-data/optfde01 [W-S] : 00412
2 : 10 cust/custmas-ctr/my-counters/working-data/optfde01 [W-S] : 00003
(gdb) cprint/ve 2
$4 = 00003
(gdb) cprint/ve rec
$5 = 005
(gdb) cprint myvar($4,$5)