How do I call a class instance method while debugging in eclipse?
For example lets say I have the following code:
...
Canvas canvas = m_SurfaceHolder.lockCanvas();
canvas.drawColor(0xff000000);
...
And I have a breakpoint on the line canvas.drawColor. When I debug, the code stops at that line and I can view the variables inside canvas, but I also want to be able to call the methods inside canvas to see what they return like I can in visual studio, is this possible?
A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead.
On the code, Right-click -> Inspect to see the value. You can select an expression then open Context Menu -> Inspect or press CTRL + Shift + I, during debugging, the result will be displayed.
Use F5 to trace into, F6 to step over, CTRL-SHIFT-B to set/remove breakpoints.
Open the Display view, type the code you want to execute in it, select it, right-click, and click "Execute", "Display" or "Inspect", depending on what you want to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With