Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing Coverage From Prior Debug Session #122

Open
jmmittan opened this issue May 8, 2022 · 7 comments
Open

Clearing Coverage From Prior Debug Session #122

jmmittan opened this issue May 8, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@jmmittan
Copy link

jmmittan commented May 8, 2022

I was able to obtain accurate coverage highlighting once the extension was set up properly. However, if I stop my debugging session and start a new session, the coverage highlighting from the prior session is still present. This would be a perfectly good feature if I could find a method of clearing highlighting whenever I wish. I wish to know that I have retested everything after I have made my last changes to my program. Am I missing something, or is this a missing feature? I am running under Windows 10 , not using Docker if that makes a difference.

@OlegKunitsyn
Copy link
Owner

You are right, atm a reset point of the coverage is recompilation. You may turn coverage off, but its not the case. Can you suggest an event when the coverage must be turned off.

@GitMensch
Copy link
Contributor

The event should be an extension command "clear coverage data".

@GitMensch
Copy link
Contributor

Also: could you possibly split this extension into two? That would be very useful:

  • gnucobol-debug can depend on the new one, so installing it would install both
  • the split "coverage-data" would visualize the data and provide commands like "clear coverage data"

In this case the coverage-data part can also be used for any other GCC based project (or clang, not sure if they have the same format or this extension already support both) - and also GnuCOBOL programs that were compiled outside of gnucobol-debug.

@jmmittan
Copy link
Author

jmmittan commented May 8, 2022

Oleg, you are probably right that recompilation causes "clear coverage data", but that may not be the problem area. Rather, it may be a problem with the red and green highlighting in the editor. Being new to VS code, extensions, JavaScript, etc. I verified external to VS code that compilation did occur on entering a new debugging session (Windows File Explorer shows that the Modified Date of my .exe file changed to start date and time of the new session.) There was a breakpoint set on the first executable line in the procedure division, so when I started a new session, I expected to see all the green highlights from my prior test to be removed when that breakpoint was reached. Instead, all highlights were still there. Playing around, adding additional lines of procedure division code would occasionally result in the new line of code showing as green, even though there was no possibility that it had been executed, This is probably due to an adjacent line of code that was already green, and the editor cloning the highlighting on the new line. Being new, I did not try debugging the extension, or verifying that the coverage data in the gcovFiles array was correct.

I see two possible ways of addressing this issue. One is providing a way for the user to clear the highlights. The other is to clear all highlights at the beginning of each new debugging session. I do not have a preference as to which option is chosen. I will say that I have a large (7000 line) program that I plan to switch to VS code/GnuCobol from OpenCobolIDE. I am hoping that subprogram support is better here, and that this issue does not reoccur when subprograms are involved.

BTW, this is not a show stopper for me. I am just happy to have access to a Cobol debugger that allows me to fully control what compiler options I use.

@jmmittan jmmittan closed this as completed May 8, 2022
@OlegKunitsyn
Copy link
Owner

I'll reopen it as a feature request.

@OlegKunitsyn OlegKunitsyn reopened this May 8, 2022
@OlegKunitsyn OlegKunitsyn changed the title Clearing Coverage From Prior Debug Session? Clearing Coverage From Prior Debug Session May 8, 2022
@OlegKunitsyn OlegKunitsyn added the enhancement New feature or request label May 8, 2022
@GitMensch
Copy link
Contributor

GitMensch commented May 8, 2022 via email

@jmmittan
Copy link
Author

jmmittan commented May 8, 2022

Thanks for managing my expectations with respect to subprograms. I have checked out Gix IDE, and found that it is a non-starter for my application at present, as my app employs several arrays where the indexes/subscripts are allowed to be zero or even negative. Gix IDE compilation options cause the debugger to reject these references at run time. Recompiling everything under this extension is not a big deal, as currently, my app is one massive program, and the debugger definitely allows non-positive values for subscripts. OCIDE's linter was quite irritating, as it flags every line of a data division copybook as an error, and that in turn makes normal methods of linking to subprograms too much of a hassle. And since OCIDE is no longer supported, I will probably make the switch to VScode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants