HLASM Toolkit Feature Interactive Debug Facility User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Dynamically loaded programs (TSO)

HLASM Toolkit Feature Interactive Debug Facility User's Guide
GC26-8709-07

The IDF DBREAK command provides a powerful deferred breakpoint facility to allow the simple debugging of programs that are dynamically loaded with standard system calls. See DBREAK for details.

Warning: If your program is dynamically loaded, and then deleted from storage, any existing breakpoints are invalidated. Use the IDF DROP MODULE command to notify IDF that the module definition is no longer valid.

DROP MODULE removes all breakpoints that are currently defined for locations within this module. Any deferred breakpoints (from previous DBREAK commands) are reactivated in case this module is loaded into storage again, possibly at a different location.

If your program is dynamically loaded in a manner that is not supported by DBREAK (such as having your own routine that loads and relocates an object module), you need another solution.
  • The basic need is for IDF to gain control when your program begins execution.
    • If you are using the SVC97 option, you should insert an SVC 97 (X'0A61') at the entry point of your program using one of the following methods:
      • If your program is written in assembler, insert an SVC 97 opcode in your program source.
      • If a Load Module editor is available, change the opcode at the entry point to an SVC 97. Record the original opcode for later restoration.
      • Use a binary editor (such as the ISPF (PDF) editor in HEX mode), to edit the Object Module to change the opcode at the entry point to an SVC 97. Record the original opcode for later restoration.
    • If you are using the NOSVC97 option, you should insert an invalid opcode (such as X'0000') at the entry point of your program using one of the following methods:
      • If your program is written in assembler, a DC X'0000' data directive in your program source.
      • If a Load Module editor is available, change the opcode at the entry point to X'0000'. Record the original opcode for later restoration.
      • Use a binary editor (such as the ISPF (PDF) editor in HEX mode), to edit the object Module to change the opcode at the entry point to X'0000'. Record the original opcode for later restoration.

    See also LANGUAGE LOAD.

  • Invoke IDF (use the COMMAND option, as described in Programs requiring environmental setup (TSO)), and press the RUN key.
  • IDF issues the command you specified with the COMMAND option, and your program is dynamically loaded into memory. It then executes the instruction (SVC 97 or X'0000') that you inserted.
  • IDF issues a message saying that either an operation exception occurred or a breakpoint was reached.
  • At this point:
    • If an extra instruction (X'0000') or the SVC 97 was inserted, you need to open the Current Registers window, and use IDF's register typeover capability to update the PSW to advance the current execution address by 2.

      You can optionally replace the SVC 97 (or X'0000') by a NOPR R0 (X'0700') instruction. This stops IDF receiving control at this location if the instruction is executed again.

    • If an existing instruction was replaced (by an SVC 97 or X'0000'), you can restore the modified instruction to its original value by opening a Disassembly window or Dump window and using IDF's storage typeover capability.
  • You should now be able to continue debugging the program as usual.

For information about source level support for dynamically loaded programs, see Source level support.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014