Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Notes on debugging object-oriented COBOL programs

  • Addressing

    • Classes are addressed by a source qualification: S=<class>, where <class> is the name specified in the CLASS-ID paragraph.

    • Methods are addressed by a procedure qualification:
      PROC={FACTORY | OBJECT}.PROC=<method>, where <method> is the name specified in the METHOD-ID paragraph.

      A source qualification is required whenever the current program location is not in (a method of) the class.
      Procedure qualifications are only needed to the extent required for unique identification. Consequently, PROC={FACTORY | OBJECT} can always be dropped for methods, since the method name must be unique in the class.

  • Commands

    • Setting test points

      Test points can be set in methods by using a source and procedure qualification:

      %INSERT [S=<class>.] [PROC=<method>.] srcref

      Write monitoring can be set on an object reference with:
      %ON %WRITE(objref)
      However, an object reference modified by NEW can only be displayed after returning to the calling point.

    • Tracing

      Classes and methods can be specified as the trace area with %TRACE as follows:

      %TRACE <n> IN S=<class>.[PROC={FACTORY | OBJECT}.PROC=<method>]

    • Displaying data

      %DISPLAY

      The data of an object is only visible if the interrupt point lies in a method of that object. No qualification is specified in such cases.

      The data in a method is only visible within that method.

      An object reference is displayed as follows:

      <level> objref
              <level+1> FACTORY | OBJECT | NULL
              <level+1> class-name
      

      The first component indicates whether the reference points to the factory object or a normal object or whether a null reference is involved. The second component shows the class name of the currently referenced object and is dropped for null references.

      %SD

      %SD shows the data in the current dynamic call hierarchy of programs and methods. In the case of methods, only the local data of the method is displayed, not the data of the surrounding object.
      In addition, the global data for a source module such as the _COMPILATION_DATE, for example, is output per class.

    • Editing data

      %SET, %MOVE

      High-level assignments to object references are rejected by AID with an error message (Types are not convertible...). Low-level access to object references is possible, but entirely at the user’s own risk.