OlegKunitsyn/gnucobol-debug

WATCH broken?

Closed this issue · 14 comments

env: gnucobol-debug 1.31.24 and GC-3.1-rc1 (Arnold's build)

Always when adding to WATCH I get an error, either

SyntaxError: Unexpected number (in this case written exactly as it is in the program XKC)

or, when using a different casing

ReferenceError: XKc is not defined

similar, when it contains a hypen (in this case Z-NAMe)

ReferenceError: Z is not defined

or, for some variables (in this case Z-NAME):

not available

Can you share the expressions you used, exactly the way you typed them in the WATCH Panel?

Exactly like I've put them in code blocks above: XKC, XKc, Z-NAMe, Z-NAME.

Hey. So let's try to understand what is happening.

For XKC, Could you provide its variable type and its expected value?

For XKc, the function that looks up for COBOL variables is case sensitive, so the response may not be the best, but it looks reasonable if the variable is not defined.

For Z-NAMe, it looks like the same problem of XKc, as the lookup function is case sensitive, it couldn't find the variable, it replies to the eval function as a variable without reference, but then as in JavaScript - is recognized as an operator, the eval function throws a Z is not defined as Z would be the first variable.

For Z-NAME, does it have zero value? I saw here that when the value is zero is changes the result to 'not available'.

It looks like we have three different bugs:

  • The first one is not exactly clear (related to XKC);
  • The second is to stop expression evaluation when there is a not found COBOL variable / improve the message when the expression is not valid;
  • The extension is treating zero as null;

I'll wait for more details to tackle the bugs. Would it be possible sharing the COBOL code?

Z-NAME was (wrongly) recognized as "group item" with a value of "", it is defined as 01 Z-NAME PIC X(47). in WORKING-STORAGE SECTION.
XKC was (wrongly) recognized as "group item" with a value of '\000' <repeats 199 times>"", it is defined as 01 XKC PIC X(200). in FILE SECTION.

To understand the problems related to these two variables I will need more details on the C code, as the extension goes through it looking for attributes, data storages, and fields.

Could you share what is defined in the files *.c.l.h and *.c.h for these variables? I mean, All definitions for Z-NAME and XKC that have references to cob_u8_t, cob_field and cob_field_attr.

The other points are fixed, including case insensitive variable lookup.

@GitMensch the fixes for all bugs were merged into the master, I am not sure if the one related the XKC variable was fixed, but indeed there was a bug on data storages and fields with the same name.

As soon as @OlegKunitsyn releases a new tag, could you check it?

I would recommend the tests before releases. It's not too complicated to deliver reliable software. Pull, remove out folder, F5.

What do you mean by that?

I think @OlegKunitsyn meant: please build the extension yourself and test it, if everything is fine I do the release.
As I only have a minimal codium setup (RHEL7 command line only + x window system + fonts, only started with an Xserver on another machine - the system doesn't have one) I'd prefer not to install anything (and git is of course also not available) on that machine [vsix gets send to the machine via scp, too].

But I'd test those changes if we could have a CI built vsix, that could either happen on each commit or only for commits to a "release" branch.

Hi @GitMensch , did you have time to review this issue? I think we still have one bug to kill here, don't we?

@GitMensch I believe most of the bug were killed. If the last one is still happening, you can open a new issue to tackle it.