[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cobol

Title:VAX/DEC COBOL
Notice:Kit,doc,performance talk info-->DIR/KEY=KIT or DOC or PERF_TALK
Moderator:PACKED::BRAFFITT
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3250
Total number of notes:13077

3221.0. "Cobol incorrectly defines labels for Debugger use" by CSC32::D_SANFORD () Wed Mar 26 1997 21:38

    OpenVMS VAX V6.2
    Cobol V5.3-40

    It appears when using labels in Cobol that it creates a symbol which
    represents the PC address of the line where the label resides.  In
    the example below this address is not correct.

    Example to duplicate problem can be found on:

	CSC32::DISK36:[J_PHILLIPS.MAHER]

	404SHIPINS.DAT;1
	CIALL.DAT;1
	PDP15.DAT;1
	SHIPINS.COB;3
	SHIPINS.EXE;4
	SHIPINS.FLB;1
	SHIPINS.FRM;1
	SHIPINS.LIS;2
	SHIPINS.OBJ;1

    This does not look like a DEBUG problem since DEBUG is only setting
    a break at the PC defined by this symbol.  Sorry if this has already
    been discussed, I normally don't support Cobol and was working this
    issue because I believed it was a problem with the OpenVMS Debugger.

    Regards, Drew Sanford
    Language Support Team
    C961212-741

  To duplicate:

$ co :== a
$ area :== f
$ cobol/debug shipins
$ link/debug shipins


$ run shipins

         OpenVMS VAX DEBUG Version V6.2-000

%DEBUG-I-INITIAL, language is COBOL, module set to SHIPINS

DBG> set br 1400-verify-it
DBG> sho sym/address 1400-verify-it
block SHIPINS\MAINLINE\1400-VERIFY-IT
    address: 52011, size: 135 bytes
DBG> ex 52011
SHIPINS\MAINLINE\1400-VERIFY-IT\%LINE 2340:     CMPB     W^2416(R11),I^#65
DBG> t 2340
module SHIPINS
  2340:        CALL "FDV$PUTL" USING BY DESCRIPTOR   D-ERROR-MSG
DBG> t 2344
module SHIPINS
  2344: 1400-VERIFY-IT.

DBG> GO

  Enter "TEST111111", if you hit the "BREAK" this is not correct
  behavior.  Correct behavior is to miss this break point 
  altogether, the application will prompt at the bottom of the
  screen.

  Workaround is to use:

    DBG> SET BREAK %LINE 2344
T.RTitleUserPersonal
Name
DateLines
3221.1Debug break behavior duplicated with VAX COBOL V5.4PACKED::BRAFFITTSat Mar 29 1997 10:3527
>DBG> GO
>
>  Enter "TEST111111", if you hit the "BREAK" this is not correct
>  behavior.  Correct behavior is to miss this break point 
>  altogether, the application will prompt at the bottom of the
>  screen.

    I duplicated what you are seeing here with
    
    	VAX COBOL V5.4
    	OpenVMS VAX V7.0
    
    I also did
    
    	SET BREAK %LINE 2340
    
    and that break also showed the paragraph label that is really at line
    2344.
    
    The workaround to use right now is the one you identified:
    
>  Workaround is to use:
>
>    DBG> SET BREAK %LINE 2344
    
    We'll post a note here when we understand what is causing this label to
    be tied to line 2340 instead of line 2344.
3221.2CSC32::D_SANFORDTue Apr 01 1997 18:426
    This problem will be formally elevated from the field, priority 2
    CLD.  The customer does not believe that the workaround works,
    instead they believe that the LISTing line numbers are off from the 
    actual code being executed.
    
    -drew
3221.3Update sent on casePACKED::BRAFFITTWed Apr 02 1997 19:3251
From:	SPSEG::SDT_ACE "02-Apr-1997 1505 -0500"  2-APR-1997 15:07:43.28
To:	@PTT$MAIL:DEC_COBOL-FYI
CC:	
Subj:	Closed Case 71GB40036 (PM-04/01/1008-enginering escallation for george nemitz)

[This update was sent from BLOTCKY on  2-APR-1997 15:04:58.11]
[Problem submitter responsible for next action, Closure Pending]

Hello,

The situation reported in this case is a restriction. It should not be
a CLD. For this reason, I'm putting it in the SOLVE state.

I have attached an update from COBOL Engineering, which describes why
this is a restriction.

Regards,
Pamela Blotcky
DTN 381-0918

_______________________________________________________________________________

VAX COBOL is an optimizing compiler.  The linkage of debug information for
source lines and labels and generated code is approximate (not exact) because
of the impact of various optimizations.  Fortunately in this case, one of the
ways to set a break at the desired line produces the debug results that the
customer wants.

>4. Configuration
>   o Operating System and Version.
>
> Customer run VAX/VMS 6.1, but problem can
> be duplicated on VMS 6.2
>
>   o Layered Product/Component Name and Version.
>
> COBOL 5.3-40

I verified back through VAX COBOL V5.0 (May-1992) that VAX COBOL has been
producing the same debug behavior you are seeing today with this particular
program.  I also duplicated the same debug behavior that the customer is seeing
with VAX COBOL V5.4 on OpenVMS VAX V7.0.

With DEC COBOL, which has even more aggressive optimizations that make
debugging of the optimized code even more challenging, there is a compile
option to disable some of the optimizations during debugging, but VAX COBOL
does not currently have an option to disable code generation optimizations.

For future versions of VAX COBOL, we will look into possible options we could
provide to disable some optimizations to make the debugging of the partially
optimized code less difficult than what is available today with VAX COBOL.