Example: Generate the Class Trace for Hanoi (Integrated Debugger)

To generate a trace for the Sample Hanoi application:

  1. If the Hanoi Sample package has not yet been added from the repository to the workspace, add the package com.ibm.ivj.examples.hanoi from the IBM Java Examples project.
  2. In the Options dialog, on the Debugging page, enable the Trace class initialization for running programs checkbox.
  3. Go to the method com.ibm.ivj.examples.hanoi.Hanoi.main().
  4. Set a breakpoint by double-clicking on the margin next to the line that prints the message "Puzzle solved!"
  5. Run the Hanoi application.  When the program reaches the breakpoint, the Debugger browser will open.
  6. Select the Hanoi program (the first entry) in the All Programs/Threads pane of the Debugger.
  7. The Source pane will show the trace, which looks similar to the following trace output:
    com.ibm.ivj.examples.hanoi.Hanoi.main() (6/11/98 11:10:01 AM)
    Class Load and Initialization Trace
    <Initialized: java.lang.Thread>
    <Initialized: java.lang.ThreadGroup>
    <Initialized: com.ibm.ivj.examples.hanoi.Hanoi>
    <Initialized: java.lang.Number>
    <Initialized: java.lang.Float>
    <Initialized: java.lang.Double>
    <Initialized: java.lang.Math>
    <Initialized: java.lang.Integer>
    <Initialized: com.ibm.ivj.examples.hanoi.Post>
    <Initialized: com.ibm.ivj.examples.hanoi.Disk>
    <Initialized: java.lang.Runtime>
    <Initialized: com.ibm.uvm.lang.AbstractEvaluationResult>
    <Initialized: com.ibm.uvm.lang.EvaluationResult>
    <Initialized: java.lang.Boolean>
    <Initialized: java.lang.reflect.Field>
    <Initialized: java.lang.reflect.Member>
  8. Once you have examined the trace, resume running the program by clicking the Resume button resume.gif (1020 bytes).

When the program is finished, return to the Options dialog and disable the Trace checkbox option to return to normal running performance.