This tutorial uses the Hello COBOL World application which you created earlier to demonstrate how debugging works in Eclipse.
You are going to add some extra code to your application that will help demonstrate some of the debugging features:
01 source-string pic x(10) value "AAbbAAbbCC".
inspect source-string replacing all 'A' by 'D' display source-string inspect source-string replacing characters by 'Q' before initial 'C' display source-string
The source-string variable is a string that has an initial value of "AAbbAAbbCC". Some of the string characters are replaced during the execution of this program.
This configuration uses HelloCOBOLWorld as the project to run and New_Configuration.bin/HelloCOBOLWorld.exe (Windows) or New_Configuration.bin/HelloCOBOLWorld (UNIX) as the main program to run.
You get prompted to switch to the debug perspective. Click Yes to confirm. This starts the debugger and it stops on the first line in the PROCEDURE DIVISION.
Some of the views of the Debug perspective you can see are:
You can now step through the code and see how the value of the SOURCE-STRING changes:
The first line in the program executes and the cursor moves to the next line in the code.
This executes the DISPLAY statement. Check the Windows Task bar for the application's console window which now also displays the value of SOURCE-STRING.
The cursor moves to the line that has the COPY statement and the debugger opens the HELLO.cpy copybook.
Debugging stops and if you want to see the project, click the COBOL button in the right upper corner of Eclipse to change the perspective to the COBOL one.
You can save the project for future reference.