I just started developing Android apps in Eclipse. I usually code in Visual Studio, and there is one thing that I just cant figure out how to do in Eclipse:
For example, if i have the following method, and want to inspect the variable i:
public void Foo()
{
int i = 1;
}
In visual studio, I am able to set the breakpoint on the closing }, and can inspect the variable:
public void Foo()
{
int i = 1;
} // <-- Breakpoint here
But in Eclipse, I'm only able to set it on the variable itself:
public void Foo()
{
int i = 1; //<-- Here
}
Which result in that i cannot inspect the variable, unless i add another line of code and break later in the method.
TL;DR: How do I inspect a variable in Eclipse while I'm in debug mode?
Create a method exit breakpoint instead of a normal breakpoint.
Just F6 over your allowed breakpoint and cntrl+shift+i on the variable you wish to inspect. Jobs a good 'un. The closing brace is a line of code so the debugger won't skip out of the method thus losing your reference.
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