vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

msgwait on missing source and other debug issues.

Open david-j-gibson opened this issue 2 years ago • 6 comments

May be a duplicate of #1059. I’m not clear on why that issue was ultimately closed, or if the details of my case are different enough to matter, so, I’m erring on the side of new issue. This is from attempts with v1.7.7 of the Code for IBMi extension.

My exact case is that I’m trying to debug a CLLE program, built with CRTBNDCL. In the course of running the program uses some commands whose history on the system I do not know (I’m a relative newcomer on a rather mature environment) but which do not seem to have source.

Regardless of if I’m stepping through the source a line at a time or just hitting go and letting it run straight through, as soon as it hits one of those commands I get a new tab in VSC, all with text along the lines of


Could not load source '[some path]': EQARD1066E The debug engine could not locate the source or listing file [same some path].

With actual path values in them, of course.

If I step past that I get CPF4203 error messages on the queue, errors from within said commands when trying to open a log file. This may be related to some aspect of the environment for the job? I’m not sure what to check to investigate that possibility, if I submit a job with the program from my normal terminal session it completes without any issue. I can also debug no problem with a service entry point in RDI. I haven’t done that many test cases so this error may or may not be universal, but it’s what I’ve seen so far.

Also I get some info in the debug console in vscode when I try this… Cannot set breakpoint on line that is not executable. Server: CPF7E12 Identifier does not exist. Server: CPF7E12 Identifier does not exist. Server: CPF7E12 Identifier does not exist. Server: CPF7E12 Identifier does not exist. Server: CPF7E12 Identifier does not exist. DBGB0004E Cannot set breakpoint on line that is not executable. DBGP0003E Program received unmonitored exception RNX1217: Error message CPF4203 appeared during OPEN.

david-j-gibson avatar Mar 24 '23 17:03 david-j-gibson

Are you calling the commands without source from the CL? If you have RDi, you can try to debug the same program as batch on RDi. If RDi also sends out the "Could not load source" message when it runs through these commands, then this may be an expected behavior.

For the "Cannot set breakpoint on line that is not executable" message, you can see what breakpoints are available in the Breakpoints view. It is likely to be caused by a breakpoint that you set for a previous debug session, which does not apply to the current program being debugged.

The "Server: CPF7E12 Identifier does not exist." is most likely caused by an existing expression in the Watch view. The expression may be added at a previous debug session. And it is not valid in the current debug session.

The Breakpoints view and the Watch view would persist the entries across multiple debug sessions by default. You can remove the breakpoints and watch expressions if they are no longer valid.

mkwan01 avatar Mar 24 '23 18:03 mkwan01

I've gone back to verify my watch and breakpoint lists are empty. There may have been lingering in my previous session but if so they're gone now, and the identifier and breakpoint messages are also gone, so that's good.

As mentioned in the main issue I've tested debugging it in RDi using the service entry system and it works fine there, no messages. Your questions prompted me to poke around RDi's interface further and I found the run>debug as menu option and got a submitted batch launch working there too. It behaves the same as the service entry point did: In RDi if I run through with no breakpoints it runs perfectly fine. In VSC it breaks into debugging when execution hits one of these commands. In RDi if I do step into an unreachable source file I get a tab with information to that effect and some options on how to proceed. It does not spawn the system messages that I get when this happens in VSC.

david-j-gibson avatar Mar 24 '23 20:03 david-j-gibson

When we run through a program without source, the expected behaviour is that the debugger does not stop and the "source not found" message should not appear. I will try to see if I can create a test case to reproduce this issue. This could be a vscode specific limitation.

mkwan01 avatar Mar 27 '23 14:03 mkwan01

I am not able to reproduce the problem. I created two CL programs, with CL1 calling CL2, and removed the source for CL2. When I debug CL1 and step over or run through the call to CL2, the "source not found" message would not appear. The vscode debug behaviour is the same as the RDi behaviour.

Please provide a sample source to show the problem if you want us to take a deeper look. Thanks.

BTW, I am using vscode 1.58.2. Not sure whether the vscode version has an impact.

mkwan01 avatar Mar 28 '23 18:03 mkwan01

@mkwan01 I might recommend you update VS Code. 1.58.2 is very old. We don't even support it here.

worksofliam avatar Mar 28 '23 19:03 worksofliam

I tried on vscode 1.76.2. No message comes up when I step over or run through a call to a CL program without source.

mkwan01 avatar Mar 28 '23 19:03 mkwan01