marcsosduma / cobgdb

Command-Line Debugger for GnuCOBOL on Linux and Windows
GNU General Public License v3.0
5 stars 1 forks source link

FR: Automatic initial Breakpoint when DECLARATIVES are present #29

Closed eugeniodilo closed 8 months ago

eugeniodilo commented 8 months ago

The debug / animator session currently automatically creates a BREAKPOINT at the first PROCEDURE DIVISION statement. If the program has DECLARATIVES (which must necessarily be positioned at the beginning of the PROCEDURE DIVISION) then the automatic BREAKPOINT is positioned at the first statement after the DECLARATIVES which is not the first statement that will be executed by the program. See a sample at following figure.

DECLARATIVES-01

In cases like this the automatic BREAKPOINT should be set to the first statement after the END DECLARATIVES. This is in fact the first statement that will be executed by the program. See following figure.

DECLARATIVES-02

If it can be useful for testing, I attach the GnuCOBOL source program with DECLARATIVES (it is a program that allows you to manage a simple master file). Select 01 ADD function at first use will activate the DECLARATIVES to create the master file.

MASTER.COB.TXT

marcsosduma commented 8 months ago

Hello! I made a change to try to fix this issue with 02672f4f776cca35cdcb93f8d594de378af72e14.

eugeniodilo commented 8 months ago

I confirm. the problem has been fixed. good job and well done. This product gets better and better.