Highlighted
Super Contributor.
Super Contributor.
141 views

Visual Studio IDE freezes When Debugging Managed COBOL

Jump to solution

I am using Microsoft Visual Studio Community 2019 Version 16.7.3. I am able to "Step Into" "F11"  with no problem. But if I choose to "Add Watch" (see screen shot) on a variable, my environment freezes up. I have included a screen shot of my Debug Options. I really need this option in order to debug my program. 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Super Contributor.
Super Contributor.

Chris,

It looks like the stack size was indeed the culprit.  Yes, I received a Stack Overflow Exceptions error a month ago. I read an articles at the following link: https://community.microfocus.com/t5/Visual-COBOL-Knowledge-Base/Diagnose-and-fix-Stack-Overflow-exceptions-in-Visual-COBOL/ta-p/1743761#

The article suggested that a program change can usually solve the problem. I did not choose this avenue because it would have required a substantive change to the program given that it contains nested performs. The article also suggested increasing the stack size to ILSTACKSIZE(2097152) which is 2mb. But that amount of space did not work so I just kept increasing it until it worked with ILSTACKSIZE(99097152) which I believe is 9mb. I just changed the stack to ILSTACKSIZE(89097152) which is 8mb and it seemed to have solved the 'Add Watch" problem. I also tested the program that was giving me a stack over flow after decreasing the ILSTACKSIZE size to see if it would give me an error and it seems to be working fine.

What is the best recommendation with stack sizing? I would like to decrease it as much as possible but am concerned that it will give me stack overflows in my programs. 

View solution in original post

0 Likes
9 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

When does the freeze occur, is it directly after the Add Watch or after pressing F11 after the Add Watch?

Does this same behavior occur with all variables that you add to a watch or just this specific variable?

Does this behavior occur in other projects such as one of the managed projects in the Samples Browser?

Which product version are you using, VC 6.0?

0 Likes
Highlighted
Super Contributor.
Super Contributor.

The freeze occurs after the Add Watch and it happens with any variables I Add Watch to.This seems to be a problem with only one solution. In troubleshooting this problem, I found that if I add a Breakpoint at the beginning of the executable program, then it does not freeze when I Add Watch. But I do get, however, an Exception Unhandled error if I add to many Add Watch (see screen shot). I am using VC 5.0. This solution simply does not like the Add Watch and I do not know why. 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Can you send this particular solution to me so that I can test with it here? You can either zip it up and attach it here or email it to me at chris.glazier@microfocus.com.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

The solution has two projects: A Windows Form Application project and a Procedural Multi-OutPut Project. The DLL's zip contains all the programs for the Procedural Multi-Output project.  I created a new solution with the same programs to see if the same problem persisted which they did. So I am at a loss as to what could be triggering this problem. 

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Chris,

If I put a BreakPoint anywhere before the first form in the project is displayed, then I am able to Add Watch to any variable and am able to add as many Add Watches as I want. I suppose this will be my solution for now but this surely is strange. 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

There are a couple of copybook folders that are missing so I cannot recompile the application.

C:\Mifocus1WF\COPYLIBS
C:\Mifocus1WF\COB

Any chance you can send these?

 

0 Likes
Highlighted
Super Contributor.
Super Contributor.

I have attached those folders. You will probably still get errors because the programs need access to data files which I cannot give you as they contain sensitive information.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

I can now build the solution without errors. I can single step into the application and add Watch variables and it does not hang.

Do I have to be able to run to a certain point in the application before the error exhibits itself?

Is it possible for you to reproduce the error within the application prior to the point where the data files are being accessed?

This assembly size is over 5MB and I see that you are setting ILSTACKSIZE(99097152). Were you running into stack overflow errors previously?

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Chris,

It looks like the stack size was indeed the culprit.  Yes, I received a Stack Overflow Exceptions error a month ago. I read an articles at the following link: https://community.microfocus.com/t5/Visual-COBOL-Knowledge-Base/Diagnose-and-fix-Stack-Overflow-exceptions-in-Visual-COBOL/ta-p/1743761#

The article suggested that a program change can usually solve the problem. I did not choose this avenue because it would have required a substantive change to the program given that it contains nested performs. The article also suggested increasing the stack size to ILSTACKSIZE(2097152) which is 2mb. But that amount of space did not work so I just kept increasing it until it worked with ILSTACKSIZE(99097152) which I believe is 9mb. I just changed the stack to ILSTACKSIZE(89097152) which is 8mb and it seemed to have solved the 'Add Watch" problem. I also tested the program that was giving me a stack over flow after decreasing the ILSTACKSIZE size to see if it would give me an error and it seems to be working fine.

What is the best recommendation with stack sizing? I would like to decrease it as much as possible but am concerned that it will give me stack overflows in my programs. 

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.