In order to demonstrate the Gild Debugger, we must first have a program that needs debugging. In order to have a program, we must have a problem that we need to solve. Our problem is this:
As a solution to this problem, we have the following Java source code:
The program gives the following output:
The current power of 2 is 1 The current power of 2 is 3 The current power of 2 is 5 . . . The current power of 2 is 29 The current power of 2 is 31 2^16 = 33
There are a few problems with the output. First, we can see that none of the lines, except the first, actually give a power of two; second, the message lines do not print numbers up to and including 32; third, 2^16 does not equal 33. Let's use the debugger to try and understand what is going on.