javadebuggingjdb

Using jdb to step inside object construction during execution


I use jdb for my Java development. For my application I have two classes: WordUniverseTest and WordUniverse, and the main method is contained in WordUniverseTest. When I execute WordUniverseTest inside of jdb, I construct a WordUniverse object called obj inside of the main method.

But I do not know how to have jdb leave the WordUniverseTest class and step inside WordUniverse while obj is being constructed. How do I do this?


Solution

  • You can put a regular breakpoint there stop at and then when you are actually on the line (call list to verify), you can call step into.

    As long as all your classes are known to jdb, it is going to work, I tested it.