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


Dynamically loaded programs

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.

Attention: If your program is dynamically loaded, and then deleted from storage, any existing breakpoints are invalidated. Use the IDF DROP MODULE module-name 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 an alternative solution.

IDF must be able to gain control when your program starts executing.
  • 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 in assembler, insert a DC X'0000' data directive in its source.
    • If a 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.

Invoke IDF (you need to use the COMMAND option, as described in Programs requiring environmental setup), 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 invalid instruction (X'0000') that you inserted.

IDF issues a message saying that either an operation exception has occurred, or that a breakpoint was reached.

At this point:
  • If an extra instruction (X'0000') 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 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 X'0000'), you can restore the modified instruction to the 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